Пример #1
0
 void OnStateComplete(NativeActivityContext context, ActivityInstance completedInstance, string result)
 {
     if (StateMachineHelper.IsAncestor(rootId, result))
     {
         int index = StateMachineHelper.GetChildStateIndex(rootId, result);
         context.ScheduleFunc <string, StateMachineEventManager, string>(this.internalStateFuncs[index], result,
                                                                         this.eventManager.Get(context), onStateComplete);
     }
 }
Пример #2
0
        void ScheduleChildState(NativeActivityContext context, string id)
        {
            int index = StateMachineHelper.GetChildStateIndex(this.StateId, id);

            Debug.Assert(index >= 0 && index < this.internalStateFuncs.Count);
            context.ScheduleFunc <string, StateMachineEventManager, string>(this.internalStateFuncs[index],
                                                                            id, this.EventManager.Get(context), this.onChildStateComplete);
            this.hasRunningChildState.Set(context, true);
        }
Пример #3
0
        protected override void Execute(NativeActivityContext context)
        {
            //We view the duration before moving to initial state is on transition.
            StateMachineEventManager localEventManager = this.eventManager.Get(context);

            localEventManager.OnTransition = true;
            int index = StateMachineHelper.GetChildStateIndex(rootId, this.InitialState.StateId);

            context.ScheduleFunc <string, StateMachineEventManager, string>(this.internalStateFuncs[index], this.InitialState.StateId,
                                                                            localEventManager, onStateComplete);
        }