Exemple #1
0
 public void SetResult()
 {
     if (syncContext != null)
     {
         syncContext.OperationCompleted();
     }
     scope = null;
     task.Completion.SetResult(default(VoidTaskResult));
 }
Exemple #2
0
        public void Start <TStateMachine> (ref TStateMachine stateMachine) where TStateMachine : IAsyncStateMachine
        {
            scope = ActivityScopeRetriever <TStateMachine> .GetScopeFromStateMachine(ref stateMachine);

            if (scope == null)
            {
                throw new InvalidOperationException("An async method returning AsyncTask needs to have a valid parameter of type ActivityScope");
            }

            stateMachine.MoveNext();
        }
Exemple #3
0
 internal Runner(IAsyncStateMachine machine, ActivityScope scope)
 {
     this.machine = machine;
     this.scope   = scope;
 }