iwantedue.OutlookStorage.GetMapiProperty C# (CSharp) Méthode

GetMapiProperty() public méthode

Gets the raw value of the MAPI property.
public GetMapiProperty ( string propIdentifier ) : object
propIdentifier string The 4 char hexadecimal prop identifier.
Résultat object
        public object GetMapiProperty(string propIdentifier)
        {
            //try get prop value from stream or storage
            object propValue = this.GetMapiPropertyFromStreamOrStorage(propIdentifier);

            //if not found in stream or storage try get prop value from property stream
            if (propValue == null)
            {
                propValue = this.GetMapiPropertyFromPropertyStream(propIdentifier);
            }

            return propValue;
        }

Usage Example

Exemple #1
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));
         }
     }
 }