The following code example demonstrates an event handler method that takes WorkflowCompletedEventArgs as a parameter. The OnWorkflowCompleted method is called when the WorkflowCompleted event is raised. The code uses the OutputParameters property to obtain the value associated with the Status key and writes it to the console.
This code example is part of the Sequential Workflow with Parameters SDK Sample from the Program.cs file. For more information, see Sequential Workflow With Parameters.
Shared Sub OnWorkflowCompleted(ByVal sender As Object, ByVal e As WorkflowCompletedEventArgs)
'The order status is stored in the "status" "out" parameter
Dim orderStatus As String = e.OutputParameters("Status").ToString()
Console.WriteLine("Order was " + orderStatus)
waitHandle.Set()
End Sub
static void OnWorkflowCompleted(object sender, WorkflowCompletedEventArgs e)
{
//The order status is stored in the "status" "out" parameter
string orderStatus = e.OutputParameters["Status"].ToString();
Console.WriteLine("Order was " + orderStatus);
waitHandle.Set();
}