예제 #1
0
        public void CompleteTwice()
        {
            this.completionCallbackInvocations = 0;
            this.completionCallbackState       = null;

            AsyncResult ar = new AsyncResult(CompletionCallback, asyncState);

            ar.Completed();
            ar.Completed();
            Assert.AreEqual(1, this.completionCallbackInvocations, "completionCallbackInvocations");
            bool waitResult = ar.AsyncWaitHandle.WaitOne(500, false);

            Assert.IsTrue(waitResult, "WaitOne result");
            Assert.AreSame(asyncState, this.completionCallbackState, "completionCallbackState");
        }
예제 #2
0
 internal void ProcessError(Exception error)
 {
     if (AsyncResult != null)
     {
         AsyncResult.Completed(null, error);
     }
 }