Exemplo n.º 1
0
 public static bool Validate(SetStateActivity setState, ValidationErrorCollection validationErrors)
 {
     SetStateValidator.SetStateContainment containment = new SetStateValidator.SetStateContainment();
     ValidateContainment(containment, setState);
     if (containment.validParentFound && containment.validParentStateFound)
     {
         return(true);
     }
     validationErrors.Add(new ValidationError(SR.GetError_SetStateOnlyWorksOnStateMachineWorkflow(), 0x5f2));
     return(false);
 }
Exemplo n.º 2
0
 private static void ValidateParentState(SetStateValidator.SetStateContainment containment, CompositeActivity activity)
 {
     if (activity.Parent != null)
     {
         if (activity.Parent is StateActivity)
         {
             containment.validParentStateFound = true;
         }
         else
         {
             ValidateParentState(containment, activity.Parent);
         }
     }
 }
Exemplo n.º 3
0
 private static void ValidateContainment(SetStateValidator.SetStateContainment containment, Activity activity)
 {
     if ((activity.Parent == null) || (activity.Parent == activity))
     {
         containment.validParentFound = false;
     }
     else if (SetStateValidator.IsValidContainer(activity.Parent))
     {
         ValidateParentState(containment, activity.Parent);
     }
     else
     {
         ValidateContainment(containment, activity.Parent);
     }
 }