WorkflowEventArgs Class
Provides data for workflow events.
Assembly: System.Workflow.Runtime (in System.Workflow.Runtime.dll)
System.EventArgs
System.Workflow.Runtime.WorkflowEventArgs
System.Workflow.Runtime.WorkflowCompletedEventArgs
System.Workflow.Runtime.WorkflowSuspendedEventArgs
System.Workflow.Runtime.WorkflowTerminatedEventArgs
| Name | Description | |
|---|---|---|
![]() | WorkflowInstance | Gets the workflow instance associated with the workflow event. |
| Name | Description | |
|---|---|---|
![]() | Equals(Object) | Determines whether the specified object is equal to the current object.(Inherited from Object.) |
![]() | Finalize() | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.) |
![]() | GetHashCode() | Serves as the default hash function. (Inherited from Object.) |
![]() | GetType() | |
![]() | MemberwiseClone() | |
![]() | ToString() | Returns a string that represents the current object.(Inherited from Object.) |
Note |
|---|
This material discusses types and namespaces that are obsolete. For more information, see Deprecated Types in Windows Workflow Foundation 4.5. |
Workflow events are associated with a workflow instance. A WorkflowEventArgs contains the WorkflowInstance associated with the workflow event. A WorkflowEventArgs or an object that derives from the WorkflowEventArgs class provides the data for all of the workflow events in the WorkflowRuntime class. WorkflowEventArgs is the base class for WorkflowCompletedEventArgs, WorkflowSuspendedEventArgs, and WorkflowTerminatedEventArgs.
The following code example demonstrates how to obtain a WorkflowInstance object using the WorkflowInstance property when an event handler method is called. When the WorkflowIdled event occurs, the OnWorkflowIdled method defined in this example is called. It determines which workflow is idled using the WorkflowInstance property and then gets a collection of queued items for the workflow instance by calling the GetWorkflowQueueData method. The code iterates over the collection to determine which activity is waiting for the event that idled the workflow. It then sends an exception to the workflow queue using the EnqueueItem method along with the name of the event queue item.
This code example is part of the Canceling a Workflow SDK Sample from the Program.cs file. For more information, see Canceling a Workflow.
Available since 3.0
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
System.Workflow.Runtime Namespace
Canceling a Workflow



