Exemple #1
0
 public void NotifyExecutionEvent(ExecutionStateEventArgs.State state)
 {
     switch (state)
     {
         case ExecutionStateEventArgs.State.kExecutionBegin:
             Validity.Assert(ExecutionState == (int)ExecutionStateEventArgs.State.kInvalid, "Invalid Execution state being notified.");
             break;
         case ExecutionStateEventArgs.State.kExecutionEnd:
             if (ExecutionState == (int)ExecutionStateEventArgs.State.kInvalid) //execution never begun.
                 return;
             break;
         case ExecutionStateEventArgs.State.kExecutionBreak:
             Validity.Assert(ExecutionState == (int)ExecutionStateEventArgs.State.kExecutionBegin || ExecutionState == (int)ExecutionStateEventArgs.State.kExecutionResume, "Invalid Execution state being notified.");
             break;
         case ExecutionStateEventArgs.State.kExecutionResume:
             Validity.Assert(ExecutionState == (int)ExecutionStateEventArgs.State.kExecutionBreak, "Invalid Execution state being notified.");
             break;
         default:
             Validity.Assert(false, "Invalid Execution state being notified.");
             break;
     }
     ExecutionState = (int)state;
     if (null != ExecutionEvent)
         ExecutionEvent(this, new ExecutionStateEventArgs(state));
 }
        private void OnExecutionEvent(object sender, ExecutionStateEventArgs e)
        {
            RuntimeCore runtimeCore = sender as RuntimeCore;
            FFIExecutionSession session = GetSession(runtimeCore, false);
            //If there wasn't any session created, there was no extension app 
            //registered for the session
            if (null == session)
                return;

            session.State = e.ExecutionState;
            mApploader.Notify(session);
        }