Esempio n. 1
0
        private void reportCompletion(IAsyncResult pAsyncResult)
        {
            AsyncResult        _asyncResult = (AsyncResult)pAsyncResult;
            DoWorkEventHandler _del         = (DoWorkEventHandler)_asyncResult.AsyncDelegate;

            WorkerEventArgs _doWorkArgs = (WorkerEventArgs)pAsyncResult.AsyncState;
            object          _result     = null;
            Exception       _error      = null;

            try {
                _del.EndInvoke(pAsyncResult);
                _result = _doWorkArgs.Result;
            }
            catch (Exception _ex) {
                _error = _ex;
            }

            WorkCompletedEventArgs _completedArgs = new WorkCompletedEventArgs(_result, _error, _doWorkArgs.Cancel);

            onWorkerCompleted(_completedArgs);
        }
Esempio n. 2
0
        public void ReportWorkCompleted(object pResult, Exception pError, bool pCancel)
        {
            WorkCompletedEventArgs _dataReceivedArgs = new WorkCompletedEventArgs(pResult, pError, pCancel);

            onWorkerCompleted(_dataReceivedArgs);
        }
Esempio n. 3
0
 protected virtual void onWorkerCompleted(WorkCompletedEventArgs pCompletedArgs)
 {
     ProcessDelegate(WorkCompleted, this, pCompletedArgs);
 }