You are creating a Windows Workflow Foundation custom activity by using Microsoft .NET Framework 3.5. The custom activity implements the IEventActivity interface and must communicate with a local service by using a workflow queue. The custom activity has a property named QueueName and an ActivityExecutionContext parameter named context. You need to create a queue.
Which code segment should you use?
A.
WorkflowQueue queue = context.GetService(QueueName.GetType()) as WorkflowQueue;queue.Enabled = true;
B.
WorkflowQueuingService svc = context.GetService<WorkflowQueuingService>();WorkflowQueue queue = svc.CreateWorkflowQueue(QueueName, false);
C.
WorkflowRuntime svc = context.GetService<WorkflowRuntime>();WorkflowInstance instance = svc.GetWorkflow(this.WorkflowInstanceId);instance.EnqueueItem(QueueName, this, null, false);
D.
WorkflowRuntime svc = context.GetService<WorkflowRuntime>();WorkflowInstance instance = svc.GetWorkflow(this.WorkflowInstanceId);WorkflowQueueInfo queue = instance.GetWorkflowQueueData()[0]; queue.Equals(QueueName);