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 ) ); // } }
protected override void BeginInvokeCore2(ProgressState progress) { WorkInvoker2 worker = new WorkInvoker2(DoWork2); worker.BeginInvoke(progress, new AsyncCallback(EndWork2), null); }
protected override void BeginInvokeCore2(ProgressState progress) { WorkInvoker2 worker = new WorkInvoker2(DoWork2); worker.BeginInvoke(progress, new AsyncCallback(EndWork2), null); }