Пример #1
0
        private void FibonacciWorker(int k, AsyncOperation asyncOp)
        {
            int result = Fibonacci(k);

            lock (tasks.SyncRoot)
            {
                tasks.Remove(asyncOp.UserSuppliedState);
            }
            FibonacciCompletedEventArgs e = new FibonacciCompletedEventArgs(null, false, asyncOp.UserSuppliedState);

            e.Result = result;
            asyncOp.PostOperationCompleted(onCompletedDelegate, e);
        }
Пример #2
0
 protected void OnFibonacciCompleted(FibonacciCompletedEventArgs e)
 {
     FibonacciCompleted?.Invoke(this, e);
 }
Пример #3
0
        private void WorkCompleted(object operationState)
        {
            FibonacciCompletedEventArgs e = operationState as FibonacciCompletedEventArgs;

            OnFibonacciCompleted(e);
        }