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!

Stack.Peek

Returns the object at the head of the Stack 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 top of the Stack.

Exceptions

Exception Type Condition
InvalidOperationException The Stack has no elements.

Remarks

This method can be overridden by a derived class.

a null reference (in Visual Basic Nothing) can be pushed onto the Stack as a placeholder, if needed. To distinguish between a null value and the end of the stack, check the Count property or catch theInvalidOperationException, which is thrown when the Stack is empty.

See Also

Stack Class | Stack Members | System.Collections Namespace | Pop | Push