void smtp_SendCompleted(object sender, AsyncCompletedEventArgs e) { if (e.Cancelled == true) { this.MailSent = false; this.EmailResultText = "Email sending cancelled "; } else if (e.Error != null) { this.MailSent = false; this.EmailResultText = e.Error.Message; } else { this.MailSent = true; this.EmailResultText = "Mail Sent Successfully"; } ProgressEventArguementModel args = new ProgressEventArguementModel(); args.Percentage = 100; args.Message = EmailResultText; args.ID = 0; args.HasError = !MailSent; OnUpdateProgressed(args); }
protected virtual void OnUpdateProgressed(ProgressEventArguementModel e) { UpdateProgressed(this, e); }