System.ComponentModel.AsyncOperation.PostOperationCompleted C# (CSharp) Method

PostOperationCompleted() public method

public PostOperationCompleted ( SendOrPostCallback d, object arg ) : void
d SendOrPostCallback
arg object
return void
        public void PostOperationCompleted(SendOrPostCallback d, object arg)
        {
            Post(d, arg);
            OperationCompletedCore();
        }

Usage Example

Ejemplo n.º 1
0
        private void WorkerThreadStart(object argument)
        {
            Debug.Assert(_asyncOperation != null, "_asyncOperation not initialized");

            object    workerResult = null;
            Exception error        = null;
            bool      cancelled    = false;

            try
            {
                DoWorkEventArgs doWorkArgs = new DoWorkEventArgs(argument);
                OnDoWork(doWorkArgs);
                if (doWorkArgs.Cancel)
                {
                    cancelled = true;
                }
                else
                {
                    workerResult = doWorkArgs.Result;
                }
            }
            catch (Exception exception)
            {
                error = exception;
            }

            var e = new RunWorkerCompletedEventArgs(workerResult, error, cancelled);

            _asyncOperation.PostOperationCompleted(_operationCompleted, e);
        }
All Usage Examples Of System.ComponentModel.AsyncOperation::PostOperationCompleted