NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Queue.Peek

Returns the object at the head of the Queue without removing it.

[Visual Basic]
Overridable Public Function Peek() As Object
[C#]
public virtual object Peek();
[C++]
public: virtual Object* Peek();
[JScript]
public function Peek() : Object;

Return Value

The object at the head of the Queue, if the Queue is not empty; otherwise, a null reference (in Visual Basic Nothing).

Exceptions

Exception Type Condition
InvalidOperationException The Queue is empty.

Remarks

This method can be overridden by a derived class.

This method is similar to the Dequeue method, but Peek does not modify the Queue.

See Also

Queue Class | Queue Members | System.Collections Namespace | Enqueue | Dequeue