/// <summary> /// Raises the SendAsyncCompleted event. /// </summary> /// <param name="e"></param> protected virtual void OnSendAsyncCompleted(SendAsyncCompletedEventArgs e) { if (SendAsyncCompleted == null) { return; } SendAsyncCompleted(this, e); }
private void SendAsyncWorker(object args) { var sendArgs = args as SendAsyncThreadArgs; SendAsyncCompletedEventArgs e; try { var status = MAPI32.SendMail(this, sendArgs.ShowDialog); e = new SendAsyncCompletedEventArgs(status); } catch (Exception ex) { e = new SendAsyncCompletedEventArgs(ex); } finally { IsSending = false; } sendArgs.Operation.PostOperationCompleted(mSendAsyncCompleteCallback, e); }