Ejemplo n.º 1
0
        // This is the method that the underlying, free-threaded
        // asynchronous behavior will invoke.  This will happen on
        // an arbitrary thread.
        private void RefreshWeaveDataCompletionMethod(Exception error, bool cancelled, AsyncOperation asyncOperation)
        {
            // If the task was not previously canceled,
            // remove the task from the lifetime collection.
            if (!cancelled)
            {
                lock (this)
                {
                    userStateToLifetime.Remove(asyncOperation.UserSuppliedState);
                }
            }

            RefreshWeaveDataCompletedEventArgs e = new RefreshWeaveDataCompletedEventArgs(error, cancelled, asyncOperation.UserSuppliedState);
            asyncOperation.PostOperationCompleted(state => OnRefreshWeaveDataCompleted((RefreshWeaveDataCompletedEventArgs)state), e);
        }
Ejemplo n.º 2
0
 private void OnRefreshWeaveDataCompleted(RefreshWeaveDataCompletedEventArgs e)
 {
     if (RefreshWeaveDataCompleted != null)
     {
         RefreshWeaveDataCompleted(this, e);
     }
 }