internal static StateActivity FindDynamicStateByName(StateActivity state, string stateQualifiedName)
 {
     while (!state.QualifiedName.Equals(stateQualifiedName) && ContainsState(state, stateQualifiedName))
     {
         foreach (Activity activity in state.EnabledActivities)
         {
             StateActivity activity2 = activity as StateActivity;
             if ((activity2 != null) && ContainsState(activity2, stateQualifiedName))
             {
                 StateActivity dynamicActivity = (StateActivity)state.GetDynamicActivity(activity2.QualifiedName);
                 if (dynamicActivity == null)
                 {
                     return(null);
                 }
                 state = dynamicActivity;
                 continue;
             }
         }
     }
     if (state.QualifiedName.Equals(stateQualifiedName))
     {
         return(state);
     }
     return(null);
 }
Exemple #2
0
        static internal StateActivity FindDynamicStateByName(StateActivity state, string stateQualifiedName)
        {
            while (!state.QualifiedName.Equals(stateQualifiedName) && ContainsState(state, stateQualifiedName))
            {
                foreach (Activity activity in state.EnabledActivities)
                {
                    StateActivity childState = activity as StateActivity;
                    if (childState == null)
                    {
                        continue;
                    }

                    if (ContainsState(childState, stateQualifiedName))
                    {
                        StateActivity dynamicChildState = (StateActivity)state.GetDynamicActivity(childState.QualifiedName);
                        if (dynamicChildState == null)
                        {
                            return(null);
                        }
                        state = dynamicChildState;
                        break;
                    }
                }
            }
            if (state.QualifiedName.Equals(stateQualifiedName))
            {
                return(state);
            }
            else
            {
                return(null);
            }
        }
 internal static StateActivity FindDynamicStateByName(StateActivity state, string stateQualifiedName)
 {
     while (!state.QualifiedName.Equals(stateQualifiedName) && ContainsState(state, stateQualifiedName))
     {
         foreach (Activity activity in state.EnabledActivities)
         {
             StateActivity activity2 = activity as StateActivity;
             if ((activity2 != null) && ContainsState(activity2, stateQualifiedName))
             {
                 StateActivity dynamicActivity = (StateActivity) state.GetDynamicActivity(activity2.QualifiedName);
                 if (dynamicActivity == null)
                 {
                     return null;
                 }
                 state = dynamicActivity;
                 continue;
             }
         }
     }
     if (state.QualifiedName.Equals(stateQualifiedName))
     {
         return state;
     }
     return null;
 }
        static internal StateActivity FindDynamicStateByName(StateActivity state, string stateQualifiedName)
        {
            while (!state.QualifiedName.Equals(stateQualifiedName) && ContainsState(state, stateQualifiedName))
            {
                foreach (Activity activity in state.EnabledActivities)
                {
                    StateActivity childState = activity as StateActivity;
                    if (childState == null)
                        continue;

                    if (ContainsState(childState, stateQualifiedName))
                    {
                        StateActivity dynamicChildState = (StateActivity)state.GetDynamicActivity(childState);
                        if (dynamicChildState == null)
                            return null;
                        state = dynamicChildState;
                        break;
                    }
                }
            }
            if (state.QualifiedName.Equals(stateQualifiedName))
                return state;
            else
                return null;
        }