Exemplo n.º 1
0
        public static void ShowLastWin32ErrorIfNotSuccess()
        {
            int error_code = Marshal.GetLastWin32Error();

            if (error_code != 0)
            {
                ErrorBox.Show(new Win32Exception(error_code));
            }
        }
Exemplo n.º 2
0
 private void MailSentChanged(object sender, SentChangedEventArgs e)
 {
     if (e.Sent)
     {
         InfoBox.Show(Str_SentSuccessful, Str_ErrorReportHasBeenSent);
     }
     else
     {
         ErrorBox.Show(Str_SentFailed, new NotDetailedException(e.Exception.Message));
     }
 }
Exemplo n.º 3
0
 public static void EmailSentChanged(SentChangedEventArgs e)
 {
     if (e == null)
     {
         throw new ArgumentNullException("e");
     }
     if (!e.Sent)
     {
         ErrorBox.Show("E-mail sent error", new ExceptionDetails(e.Exception).Details);
     }
     else
     {
         InfoBox.Show("E-mail succesfully sent", "E-mail sent was succesfully to target e-mail address");
     }
 }
Exemplo n.º 4
0
 private void btn_SendToClipboard_Click(object sender, EventArgs e)
 {
     try
     {
         /*Thread.CurrentThread.SetApartmentState(ApartmentState.STA);
          * Clipboard.SetText(rtb_Message.Text);*/
         rtb_Message.SelectAll();
         rtb_Message.Focus();
         SendKeys.Send("^(C)");
         //rtb_Message.Select(0, 0);
     }
     catch (Exception ex)
     {
         ErrorBox.Show(ex);
     }
 }
Exemplo n.º 5
0
        private void btn_Send_Click(object sender, EventArgs e)
        {
            try
            {
                if (tb_SMTP_Server.Text == String.Empty)
                {
                    throw new Exception(Str_SMTPServerNotSet);
                }

                SendMail mailer;
                if (SendErrorReport.SmtpServer == null)
                {
                    if (!chk_Authentication.Checked)
                    {
                        mailer = new SendMail(tb_SMTP_Server.Text, chk_SSL.Checked, (int)nud_Port.Value);
                    }
                    else
                    {
                        mailer = new SendMail(tb_SMTP_Server.Text, chk_SSL.Checked, (int)nud_Port.Value, tb_Username.Text, tb_Password.Text);
                    }

                    mailer.ForceSmtpAuthentication = chk_ForceAuthentication.Checked;
                    mailer.SmtpAuthentication      = (SmtpAuthentication)cb_ForceAuthentication.SelectedIndex;

                    mailer.SentChanged += MailSentChanged;

                    mailer.Send(tb_From.Text, tb_To.Text, tb_Title.Text, rtb_Message.Text);
                }
                else
                {
                    mailer = new SendMail(SendErrorReport.SmtpServer);
                    mailer.Send(tb_From.Text, tb_To.Text, tb_Title.Text, rtb_Message.Text);
                }
            }
            catch (Exception ex)
            {
                ErrorBox.Show(Str_SentFailed, new NotDetailedException(ex.Message));
            }
        }
Exemplo n.º 6
0
 public static void ShowLastWin32Error()
 {
     ErrorBox.Show(new Win32Exception(Marshal.GetLastWin32Error()));
 }