Inheritance: IDisposable
コード例 #1
0
ファイル: Form1.cs プロジェクト: tvmani/ReadAnOutlookMsg
 /// <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");
     }
 }
コード例 #2
0
ファイル: Form1.cs プロジェクト: tvmani/ReadAnOutlookMsg
 /// <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(',');
 }
コード例 #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;
 }
コード例 #4
0
ファイル: Program.cs プロジェクト: ttasterisco/malleterisk
    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;
    }
コード例 #5
0
ファイル: Form1.cs プロジェクト: tvmani/ReadAnOutlookMsg
 /// <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));
         }
     }
 }