private void GetBody(long uid)
 {
     lock (EmailList)
     {
         var emailView = EmailList[uid.ToString()];
         if (emailView.Text == null)
         {
             lock (imap)
             {
                 BodyStructure structure = imap.GetBodyStructureByUID(uid);
                 string        text = null, html = null;
                 if (structure.Text != null)
                 {
                     text = imap.GetTextByUID(structure.Text);
                 }
                 if (structure.Html != null)
                 {
                     html = imap.GetTextByUID(structure.Html);
                 }
                 EmailViewManager.SetBody(ref emailView, text, html);
                 ListChanged = true;
             }
         }
     }
 }
 private void GetHeader(long uid)
 {
     lock (EmailList)
     {
         var emailView = EmailList[uid.ToString()];
         lock (imap)
         {
             MessageInfo info = imap.GetMessageInfoByUID(uid);
             EmailViewManager.SetHeader(ref emailView, info.Envelope.From.First().Name, info.Envelope.Subject,
                                        info.Envelope.Date?.ToString("MM/dd/yyyy hh:mm:ss"));
             ListChanged = true;
         }
     }
 }
 private void GetHeader(string uid)
 {
     lock (EmailList)
     {
         var emailView = EmailList[uid.ToString()];
         lock (pop)
         {
             MailBuilder builder = new MailBuilder();
             var         headers = pop.GetHeadersByUID(uid);
             IMail       email   = builder.CreateFromEml(headers);
             EmailViewManager.SetHeader(ref emailView,
                                        email.From.First().Name,
                                        email.Subject,
                                        email.Date?.ToString("MM/dd/yyyy hh:mm:ss"));
             ListChanged = true;
         }
     }
 }
 private void GetBody(string uid)
 {
     lock (EmailList)
     {
         var emailView = EmailList[uid.ToString()];
         if (emailView.Text == null)
         {
             lock (pop)
             {
                 MailBuilder builder = new MailBuilder();
                 IMail       email   = builder.CreateFromEml(
                     pop.GetMessageByUID(uid));
                 EmailViewManager.SetBody(ref emailView, email.Text, email.Html);
                 ListChanged = true;
             }
         }
     }
 }