You are creating a Windows Workflow Foundation custom activity by using Microsoft .NET Framework 3.5.
The custom activity has the following features:
It implements the IEventActivity interface.
It implements the CreateWorkflowQueue method that configures and returns a WorkflowQueue object.
The Subscribe method of the custom activity receives the following parameters:
An ActivityExecutionContext parameter named parentContext An IActivityEventListener<QueueEventArgs> parameter named parentEventHandler
You need to use a WorkflowQueue object to implement the Subscribe method.
Which code segment should you use?
A.
WorkflowQueue queue = CreateWorkflowQueue(parentContext);queue.Enqueue(parentEventHandler);
B.
WorkflowQueue queue =
CreateWorkflowQueue(parentContext);queue.RegisterForQueueItemAvailable(parentEventHandler);
C.
WorkflowQueue queue =
CreateWorkflowQueue(parentContext);queue.UnregisterForQueueItemAvailable(parentEventHandler);
D.
WorkflowQueue queue =
CreateWorkflowQueue(parentContext);parentEventHandler.OnEvent(parentContext, queue.Dequeue() as QueueEventArgs);