Inheritance: IDisposable
Ejemplo n.º 1
0
 /// <summary>
 /// Adds attachments for a message
 /// </summary>
 /// <param name="message"></param>
 private void AddAttachments(OutlookStorage.Message message)
 {
     foreach (OutlookStorage.Attachment attachment in message.Attachments)
     {
         attachments.AppendText(attachment.Filename + ": " + attachment.Data.Length + "b\r\n\r\n");
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Adds recipients for a message
 /// </summary>
 /// <param name="message"></param>
 private void AddRecipients(OutlookStorage.Message message)
 {
     to.Text = "";
     cc.Text = "";
     foreach (OutlookStorage.Recipient recipient in message.Recipients)
     {
         if (recipient.Type == OutlookStorage.RecipientType.To)
         {
             to.AppendText(recipient.Email + ", ");
         }
         else if (recipient.Type == OutlookStorage.RecipientType.CC)
         {
             cc.AppendText(recipient.Email + ", ");
         }
     }
     to.Text = to.Text.TrimEnd().TrimEnd(',');
     cc.Text = cc.Text.TrimEnd().TrimEnd(',');
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Attachment"/> class.
 /// </summary>
 /// <param name="message">The message.</param>
 public Attachment(OutlookStorage message)
     : base(message.storage)
 {
     GC.SuppressFinalize(message);
     this.propHeaderSize = OutlookStorage.PROPERTIES_STREAM_HEADER_ATTACH_OR_RECIP;
 }
Ejemplo n.º 4
0
    private static List<string> parseAddresses(List<OutlookStorage.Recipient> recipients, OutlookStorage.RecipientType type)
    {
        List<string> addresses = new List<string>();

        foreach(OutlookStorage.Recipient r in recipients)
            if (r.Type == type) addresses.Add(r.Address);

        return addresses;
    }
Ejemplo n.º 5
0
 /// <summary>
 /// Populates the extended data for a message
 /// </summary>
 /// <param name="message"></param>
 private void PopulateData(OutlookStorage.Message message)
 {
     data.Text = "";
     foreach (string key in message.streamStatistics.Keys)
     {
         string hexKey = key.Substring(12, 4);
         try
         {
             object property = message.GetMapiProperty(hexKey);
             if (property == null)
             {
                 data.AppendText((string.Format("Key {0} is null{1}", hexKey, Environment.NewLine)));
             }
             else if (property is byte[])
             {
                 data.AppendText(string.Format("Key {0} is a byte array{1}", hexKey, Environment.NewLine));
             }
             else
             {
                 data.AppendText(string.Format("{0}: {1}{2}", hexKey, property.ToString(), Environment.NewLine));
             }
         }
         catch
         {
             data.AppendText(string.Format("Key {0} threw an exception{1}", hexKey, Environment.NewLine));
         }
     }
 }