Exemple #1
0
        public void ConstructMailLine(UsersResource.MessagesResource.GetRequest req)
        {
            // Construct the ListViewItem object
            string text = "(no subject)";

            foreach (var header in MailService.GetMessageHeaders(req))
            {
                if (header.Name.Equals("Subject") && header.Value.Length > 0)
                {
                    text = header.Value;
                    break;
                }
            }
            ListViewItem item = new ListViewItem(text);

            item.Tag = req.Id;
            Inbox.Items.Add(item);
        }
 private void OpenPlainButton_Click(object sender, EventArgs e)
 {
     try
     {
         EmailPlainWindow emailWindow = new EmailPlainWindow();
         var req = GetSelectedItemReqById();
         emailWindow.FillMailBodyBox(MailService.GetMessageBodyPlain(req));
         emailWindow.FillSenderDetails(MailService.GetEmailWindowHeader(req));
         emailWindow.Text = MailService.GetEmailWindowHeader(req);
         emailWindow.Show();
     }
     catch (NullReferenceException)
     {
         MessageBox.Show("First select a mail to view by clicking on its subject.");
     }
     catch (ArgumentOutOfRangeException)
     {
         NoMailSelectedWarning();
     }
 }
 private void OpenHTMLButton_Click(object sender, EventArgs e)
 {
     try
     {
         EmailHTMLWindow emailWindow = new EmailHTMLWindow();
         var             req         = GetSelectedItemReqById();
         emailWindow.FillBrowser(MailService.GetMessageBodyHtml(req));
         emailWindow.FillSenderDetails(MailService.GetEmailWindowHeader(req));
         emailWindow.Text = MailService.GetEmailWindowHeader(req);
         emailWindow.Show();
     }
     catch (NullReferenceException m)
     {
         NoMailSelectedWarning();
         MessageBox.Show(m.Message);
         MessageBox.Show(m.StackTrace);
     }
     catch (ArgumentOutOfRangeException n)
     {
         NoMailSelectedWarning();
         MessageBox.Show(n.Message);
     }
 }