当前位置: 首页>>代码示例>>C#>>正文


C# Attachment.GetMapiProperty方法代码示例

本文整理汇总了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;
                }
            }
开发者ID:tonyqus,项目名称:MSGReader,代码行数:30,代码来源:Message.cs

示例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);
                }
            }
开发者ID:Developex,项目名称:Outlook-Sync-Webservice,代码行数:27,代码来源:OutlookStorage.cs

示例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;
                }
            }
开发者ID:naingyelin,项目名称:msgreader,代码行数:30,代码来源:Storage.cs


注:本文中的Attachment.GetMapiProperty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。