コード例 #1
0
        private void ReportCompletion(IAsyncResult asyncResult)
        {
            System.Runtime.Remoting.Messaging.AsyncResult ar = asyncResult as System.Runtime.Remoting.Messaging.AsyncResult;
            DoWorkEventHandler del        = ar.AsyncDelegate as DoWorkEventHandler;
            DoWorkEventArgsBw  doWorkArgs = (DoWorkEventArgsBw)ar.AsyncState;
            object             result     = null;
            Exception          error      = null;

            try {
                del.EndInvoke(asyncResult);
                result = doWorkArgs.Result;
            } catch (Exception exception) {
                error = exception;
            }

            RunWorkerCompletedEventArgsBw completedArgs = new RunWorkerCompletedEventArgsBw(result, error, doWorkArgs.Cancel);

            OnRunWorkerCompleted(completedArgs);
        }
コード例 #2
0
ファイル: BackgroundWorker.cs プロジェクト: GodLesZ/svn-dump
		protected virtual void OnRunWorkerCompleted( RunWorkerCompletedEventArgsBw completedArgs ) {
			ProcessDelegate( RunWorkerCompleted, this, completedArgs );
		}
コード例 #3
0
 protected virtual void OnRunWorkerCompleted(RunWorkerCompletedEventArgsBw completedArgs)
 {
     ProcessDelegate(RunWorkerCompleted, this, completedArgs);
 }
コード例 #4
0
ファイル: BackgroundWorker.cs プロジェクト: GodLesZ/svn-dump
		private void ReportCompletion( IAsyncResult asyncResult ) {
			System.Runtime.Remoting.Messaging.AsyncResult ar = asyncResult as System.Runtime.Remoting.Messaging.AsyncResult;
			DoWorkEventHandler del = ar.AsyncDelegate as DoWorkEventHandler;
			DoWorkEventArgsBw doWorkArgs = (DoWorkEventArgsBw)ar.AsyncState;
			object result = null;
			Exception error = null;

			try {
				del.EndInvoke( asyncResult );
				result = doWorkArgs.Result;
			} catch( Exception exception ) {
				error = exception;
			}

			RunWorkerCompletedEventArgsBw completedArgs = new RunWorkerCompletedEventArgsBw( result, error, doWorkArgs.Cancel );
			OnRunWorkerCompleted( completedArgs );
		}