You create a workflow application by using Microsoft .NET Framework 3.5. The application has a workflow that contains a WhileActivity activity named WaLoop. The workflow also has a field named Counter of type Int32. The Counter field is initialized to 0. You need to ensure that the activities in the WaLoop activity execute only 10 times. Which code segment should you use?
A.
private void MyCondition(object sender, ConditionalEventArgs e){ if (Counter >= 10) { e.Result = true; } else { e.Result = false; } Counter++;}
B.
private void MyCondition(object sender, ConditionalEventArgs e){ if (Counter >= 10) { e.Result = false; } else { Counter++; e.Result = true; }}
C.
private void MyCondition(object sender, ConditionalEventArgs e){ WhileActivity act = sender as WhileActivity; while (Counter >= 10) { Counter++; act.SetValue(DependencyProperty.FromName( "Condition", typeof(bool)), true); } act.SetValue(DependencyProperty.FromName( "Condition", typeof(bool)), false);}
D.
private void MyCondition(object sender, ConditionalEventArgs e){ WhileActivity act = sender as WhileActivity; if (Counter >= 10) { act.SetValue(DependencyProperty.FromName( "Condition", typeof(bool)), false); } else { Counter++; act.SetValue(DependencyProperty.FromName( "Condition", typeof(bool)), true); }}