Beispiel #1
0
        private void EndWork2(IAsyncResult result)
        {
            Debug.WriteLine("BasicCOmmand:EndWork2");
            AsyncResult  asyncResult   = (AsyncResult)result;
            WorkInvoker2 asyncDelegate = (WorkInvoker2)asyncResult.AsyncDelegate;

            try
            {
                asyncDelegate.EndInvoke(result);
                OnFinish(EventArgs.Empty);
            }
            catch (Exception e)
            {
                // Marshal exceptions back to the UI
                OnError(new ErrorEventArgs(e));
            }
            //            catch
            //            {
            //                // Do our exception handling; include a default catch
            //                // block because this is the final handler on the stack for this
            //                // thread, and we need to log these kinds of problems
            //                OnError( new ErrorEventArgs( null ) );
            //            }
        }
Beispiel #2
0
		protected override void BeginInvokeCore2(ProgressState progress)
		{
			WorkInvoker2 worker = new WorkInvoker2(DoWork2);
			worker.BeginInvoke(progress, new AsyncCallback(EndWork2), null);
		}
Beispiel #3
0
        protected override void BeginInvokeCore2(ProgressState progress)
        {
            WorkInvoker2 worker = new WorkInvoker2(DoWork2);

            worker.BeginInvoke(progress, new AsyncCallback(EndWork2), null);
        }