本文整理汇总了C#中Attachment.GetMapiProperty方法的典型用法代码示例。如果您正苦于以下问题:C# Attachment.GetMapiProperty方法的具体用法?C# Attachment.GetMapiProperty怎么用?C# Attachment.GetMapiProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Attachment
的用法示例。
在下文中一共展示了Attachment.GetMapiProperty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadAttachmentStorage
/// <summary>
/// Loads the attachment data out of the specified storage.
/// </summary>
/// <param name="storage"> The attachment storage. </param>
/// <param name="storageName">The name of the <see cref="Storage.NativeMethods.IStorage"/> stream that containts this message</param>
private void LoadAttachmentStorage(NativeMethods.IStorage storage, string storageName)
{
// Create attachment from attachment storage
var attachment = new Attachment(new Storage(storage), storageName);
var attachMethod = attachment.GetMapiPropertyInt32(MapiTags.PR_ATTACH_METHOD);
switch (attachMethod)
{
case MapiTags.ATTACH_EMBEDDED_MSG:
// Create new Message and set parent and header size
var iStorageObject = attachment.GetMapiProperty(MapiTags.PR_ATTACH_DATA_BIN) as NativeMethods.IStorage;
var subMsg = new Message(iStorageObject, attachment.RenderingPosition, storageName)
{
_parentMessage = this,
_propHeaderSize = MapiTags.PropertiesStreamHeaderEmbeded
};
_attachments.Add(subMsg);
break;
default:
// Add attachment to attachment list
_attachments.Add(attachment);
break;
}
}
示例2: LoadAttachmentStorage
/// <summary>
/// Loads the attachment data out of the specified storage.
/// </summary>
/// <param name="storage">The attachment storage.</param>
private void LoadAttachmentStorage(NativeMethods.IStorage storage)
{
//create attachment from attachment storage
Attachment attachment = new Attachment(new OutlookStorage(storage));
//if attachment is a embeded msg handle differently than an normal attachment
int attachMethod = attachment.GetMapiPropertyInt32(OutlookStorage.PR_ATTACH_METHOD);
if (attachMethod == OutlookStorage.ATTACH_EMBEDDED_MSG)
{
//create new Message and set parent and header size
Message subMsg = new Message(attachment.GetMapiProperty(OutlookStorage.PR_ATTACH_DATA) as NativeMethods.IStorage);
subMsg.parentMessage = this;
subMsg.propHeaderSize = OutlookStorage.PROPERTIES_STREAM_HEADER_EMBEDED;
//add to messages list
this.messages.Add(subMsg);
}
else
{
//add attachment to attachment list
this.attachments.Add(attachment);
}
}
示例3: LoadAttachmentStorage
/// <summary>
/// Loads the attachment data out of the specified storage.
/// </summary>
/// <param name="storage"> The attachment storage. </param>
private void LoadAttachmentStorage(NativeMethods.IStorage storage)
{
// Create attachment from attachment storage
var attachment = new Attachment(new Storage(storage));
// If attachment is a embeded msg handle differently than an normal attachment
var attachMethod = attachment.GetMapiPropertyInt32(MapiTags.PR_ATTACH_METHOD);
switch (attachMethod)
{
case MapiTags.ATTACH_EMBEDDED_MSG:
// Create new Message and set parent and header size
var subMsg = new Message(attachment.GetMapiProperty(MapiTags.PR_ATTACH_DATA_BIN) as NativeMethods.IStorage, attachment.RenderingPosition)
{
_parentMessage = this,
_propHeaderSize = MapiTags.PropertiesStreamHeaderEmbeded
};
_attachments.Add(subMsg);
break;
default:
// Add attachment to attachment list
_attachments.Add(attachment);
break;
}
}