You are creating a Windows Workflow Foundation custom activity by using Microsoft .NET Framework 3.5.
The custom activity has the following features:
It is derived from the System.Workflow.ComponentModel.CompositeActivity class.
It contains a single child activity.
You create a method named ExecuteChild for the custom activity. Each time the custom activity is required to execute the child activity, the custom activity invokes the ExecuteChild method.
You need to ensure that the ExecuteChild method enables the custom activity to execute the child activity more than once.
Which code segment should you use?
A.
private void ExecuteChild(ActivityExecutionContext context){ EnabledActivities[0].Closed +=
ChildActivityClosed; context.ExecuteActivity(EnabledActivities[0]);}
B.
private void ExecuteChild(ActivityExecutionContext context){ ActivityExecutionContextManager manager; manager = context.ExecutionContextManager; manager.CompleteExecutionContext(context); EnabledActivities[0].Closed += ChildActivityClosed; context.ExecuteActivity(EnabledActivities[0]);}
C.
private void ExecuteChild(ActivityExecutionContext context){ ActivityExecutionContextManager manager; manager = context.ExecutionContextManager; ActivityExecutionContext newContext; newContext = manager.CreateExecutionContext(EnabledActivities[0]); newContext.Activity.Closed += ChildActivityClosed; newContext.ExecuteActivity(newContext.Activity);}
D.
private void ExecuteChild(ActivityExecutionContext context) { ActivityExecutionContextManager manager; manager = context.ExecutionContextManager; ActivityExecutionContext newContext; newContext = manager.CreateExecutionContext(EnabledActivities[0]); newContext.Activity.Closed += ChildActivityClosed; newContext.ExecuteActivity(EnabledActivities[0]);}