Compartilhar via


ObservationQueue.TryGet Method

Gets the element at the beginning of the queue. A return value indicates whether the operation succeeded. This method supports the testing infrastructure and is not intended to be used directly from your code.

Namespace: Microsoft.SpecExplorer.Runtime.Testing
Assembly: Microsoft.SpecExplorer.Runtime (in Microsoft.SpecExplorer.Runtime.dll)

Usage

'Usage

Syntax

'Declaration
public bool TryGet (
    TimeSpan timeOut,
    bool consume,
    out T item
)

Parameters

  • timeOut
    The time-out period in which to wait for an element to enter the queue if the queue is currently empty.
  • consume
    true to remove the element from the queue; otherwise, false.
  • item
    When this method returns, contains the element from the beginning of the queue if the get succeeded or the default value for the type of element in the queue if the get failed. The get fails if the queue is empty and no elements are added to the queue within the time-out period. This parameter is passed uninitialized.

Return Value

true if item was retrieved successfully; otherwise, false.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Microsoft Windows 7, Microsoft Windows Vista, Microsoft Windows XP SP2 or later, Microsoft Windows Server 2008, Microsoft Windows Server 2003

See Also

Reference

ObservationQueue Generic Class
ObservationQueue Members
Microsoft.SpecExplorer.Runtime.Testing Namespace