You are creating a Windows Workflow Foundation code-based workflow named Workflow1 by using Microsoft .NET Framework 3.5.
You write the following code segment in the Workflow1 class.
public TimeSpan DelayTime
{
get { return _delayTime; }
set { _delayTime = value; }
}
// default delay of one hour
TimeSpan _delayTime = new TimeSpan(0, 1, 0);
You are adding an activity named delayActivity1 of type DelayActivity to the workflow. The activity must meet the following requirements:
The TimeoutDuration property value returns the DelayTime property value of the Workflow1 object. Any change in the DelayTime property value during the execution of the workflow is immediately reflected in the TimeoutDuration property value.
You need to ensure that the Workflow1 class constructor enables the activity to meet the outlined requirements.
Which code segment should you use?
A.
delayActivity1.TimeoutDuration = this.DelayTime;
B.
delayActivity1.SetValue( DelayActivity.TimeoutDurationProperty, this.DelayTime);
C.
ActivityBind bind = new ActivityBind();bind.Name = "Workflow1";bind.Path =
"DelayTime";delayActivity1.SetBinding(DelayActivity.TimeoutDurationProperty, bind);
D.
ActivityBind bind = new ActivityBind();bind.Name = delayActivity1.Name;bind.Path = "TimeoutDuration";bind.UserData.Add("TimeoutDuration",
this.DelayTime);delayActivity1.SetBinding(DelayActivity.TimeoutDurationProperty, bind);