WorkflowQueue.Peek Method ()


Returns the object at the beginning of the WorkflowQueue without removing it.

Namespace:   System.Workflow.Runtime
Assembly:  System.Workflow.Runtime (in System.Workflow.Runtime.dll)

public object Peek()

Return Value

Type: System.Object

The object at the beginning of the WorkflowQueue.

Exception Condition

The WorkflowQueue is empty.

This method is similar to the Dequeue method, but Peek does not modify the WorkflowQueue. You can check Count to determine whether the WorkflowQueue is empty before you call Dequeue, or you can catch the InvalidOperationException.

.NET Framework
Available since 3.0
Return to top