示例#1
0
        /// <summary>
        /// Get the corresponding AbstractFastTransferStream.
        /// </summary>
        /// <returns>The corresponding AbstractFastTransferStream.</returns>
        public AbstractFastTransferStream GetAbstractFastTransferStream()
        {
            AbstractFastTransferStream abstractFastTransferStream = new AbstractFastTransferStream
            {
                StreamType = FastTransferStreamType.attachmentContent
            };

            return(abstractFastTransferStream);
        }
        /// <summary>
        /// Get the corresponding AbstractFastTransferStream.
        /// </summary>
        /// <returns>The corresponding AbstractFastTransferStream.</returns>
        public AbstractFastTransferStream GetAbstractFastTransferStream()
        {
            AbstractFastTransferStream abstractFastTransferStream = new AbstractFastTransferStream
            {
                StreamType = FastTransferStreamType.attachmentContent
            };

            return abstractFastTransferStream;
        }
示例#3
0
        /// <summary>
        /// Get the corresponding AbstractFastTransferStream.
        /// </summary>
        /// <returns>The corresponding AbstractFastTransferStream.</returns>
        public AbstractFastTransferStream GetAbstractFastTransferStream()
        {
            AbstractFastTransferStream afts = default(AbstractFastTransferStream);

            afts.StreamType = FastTransferStreamType.TopFolder;

            // If the PropList is null or not contains any properties' values then the IsFolderPropertiesNotOut is true.
            afts.AbstractTopFolder.AbsFolderContent.IsFolderPropertiesNotOut = !(this.FolderContent.PropList.PropValues != null && this.FolderContent.PropList.PropValues.Count > 0);

            // If the field of WarningCode of FolderContent is not null then  IsNoPermissionObjNotOut is true.
            afts.AbstractTopFolder.AbsFolderContent.IsNoPermissionObjNotOut = this.FolderContent.WarningCode != null;
            afts.AbstractTopFolder.AbsFolderContent.IsPidTagEcWarningOut    = this.FolderContent.WarningCode != null;
            afts.AbstractTopFolder.AbsFolderContent.IsPidTagNewFXFolderOut  = this.FolderContent.HasNewFXFolder;

            // IsFolderContentNotOut Equivalent to the folderContent contains no message changes.
            // All subfolders do not contains subfolders.
            afts.AbstractTopFolder.AbsFolderContent.IsFolderContentNotOut = !(((this.FolderContent.FolderMessages != null &&
                                                                                this.FolderContent.FolderMessages.MessageTupleList != null &&
                                                                                this.FolderContent.FolderMessages.MessageTupleList.Count > 0 &&
                                                                                this.FolderContent.FolderMessages.MessageTupleList[0].Item2.Messages != null &&
                                                                                this.FolderContent.FolderMessages.MessageTupleList.Count > 0 &&
                                                                                this.FolderContent.FolderMessages.MessageTupleList[0].Item2.Messages.Count > 0) ||
                                                                               (this.FolderContent.SubFolders != null && this.FolderContent.SubFolders.Count > 0)) ||
                                                                              (this.folderContent.PropList != null));

            // If contains subFolders.
            if (this.FolderContent.SubFolders != null && this.FolderContent.SubFolders.Count > 0)
            {
                // Contains subFolders.
                afts.AbstractTopFolder.SubFolderInScope = true;

                // Check whether subFolders is Preceded By PidTagFXDelProp.
                if (this.folderContent.PropList.IsNoMetaPropertyContained)
                {
                    for (int i = 0; i < this.folderContent.PropList.PropValues.Count; i++)
                    {
                        PropValue p = this.folderContent.PropList.PropValues[i];
                        if (p.PropInfo.PropID == 0x360E)
                        {
                            afts.AbstractFolderContent.IsSubFolderPrecededByPidTagFXDelProp = true;
                            break;
                        }
                    }
                }
            }

            return(afts);
        }
示例#4
0
        /// <summary>
        /// Get the corresponding AbstractFastTransferStream.
        /// </summary>
        /// <returns>The corresponding AbstractFastTransferStream.</returns>
        public AbstractFastTransferStream GetAbstractFastTransferStream()
        {
            AbstractFastTransferStream abstractFastTransferStream = new AbstractFastTransferStream
            {
                StreamType = FastTransferStreamType.MessageContent
            };

            AbstractMessageContent abstractMessageContent = new AbstractMessageContent();

            if (this.PropList != null && this.PropList.PropValues.Count > 0)
            {
                // Check the propList of MessageContent if one PropValue is a PtypString value,
                // the StringPropertiesInUnicode of the AbstractMessageContent is true.
                for (int i = 0; i < this.PropList.PropValues.Count; i++)
                {
                    PropValue p = this.PropList.PropValues[i];
                    if (p.PropType == 0x1f)
                    {
                        abstractMessageContent.StringPropertiesInUnicode = true;
                        break;
                    }
                }

                for (int i = 0; i < this.PropList.PropValues.Count; i++)
                {
                    PropValue p = this.PropList.PropValues[i];

                    // If server stored the string using Unicode, the code page property type should be 0x84B0, which specifies the Unicode (1200) code page, specified in section 2.2.4.1.1.1.
                    if (p.PropType == 0x84b0)
                    {
                        abstractMessageContent.StringPropertiesInUnicodeCodePage = true;
                        break;
                    }
                }

                for (int i = 0; i < this.PropList.PropValues.Count; i++)
                {
                    PropValue p = this.PropList.PropValues[i];

                    // If server supports other formats (not Unicode), the PropType should not be 0X84b0, which specifies the Unicode (1200) code page, specified in section 2.2.4.1.1.1.
                    if (p.PropType - 0x8000 >= 0 && p.PropType != 0x84b0)
                    {
                        abstractMessageContent.StringPropertiesInOtherCodePage = true;
                        break;
                    }
                }
            }
            else if (this.MessageChildren != null)
            {
                // Check the propList of MessageContent if one PropValue is a PtypString value,
                // the StringPropertiesInUnicode of the AbstractMessageContent is true.
                foreach (Recipient rec in this.MessageChildren.Recipients)
                {
                    if (rec.PropList.HasPropertyType(0x1f))
                    {
                        abstractMessageContent.StringPropertiesInUnicode = true;
                        break;
                    }

                    // If server stored the string using Unicode, the code page property type should be 0x84B0, which specifies the Unicode (1200) code page, specified in section 2.2.4.1.1.1.
                    if (rec.PropList.HasPropertyType(0x84b0))
                    {
                        abstractMessageContent.StringPropertiesInUnicodeCodePage = true;
                        break;
                    }

                    for (int i = 0; i < rec.PropList.PropValues.Count; i++)
                    {
                        // If server supports other formats (not Unicode), the PropType should not be 0X84b0, which specifies the Unicode (1200) code page, specified in section 2.2.4.1.1.1.
                        if (rec.PropList.PropValues[i].PropType - 0x8000 >= 0 && rec.PropList.PropValues[i].PropType != 0x84b0)
                        {
                            abstractMessageContent.StringPropertiesInOtherCodePage = true;
                            break;
                        }
                    }
                }
            }
            else
            {
                abstractMessageContent.StringPropertiesInUnicode = false;
            }

            if (this.MessageChildren != null)
            {
                // If MessageChildren contains attachments check whether attachments Preceded By PidTagFXDelProp.
                if (this.MessageChildren.Attachments != null && this.MessageChildren.Attachments.Count > 0)
                {
                    abstractMessageContent.AbsMessageChildren.AttachmentPrecededByPidTagFXDelProp
                        = this.MessageChildren.FXDelPropsBeforeAttachment != null &&
                          this.MessageChildren.FXDelPropsBeforeAttachment.Count > 0;
                }

                if (this.MessageChildren.Recipients != null && this.MessageChildren.Recipients.Count > 0)
                {
                    abstractMessageContent.AbsMessageChildren.RecipientPrecededByPidTagFXDelProp
                        = this.MessageChildren.FXDelPropsBeforeRecipient != null &&
                          this.MessageChildren.FXDelPropsBeforeRecipient.Count > 0;
                }
            }

            abstractFastTransferStream.AbstractMessageContent = abstractMessageContent;
            return(abstractFastTransferStream);
        }
        /// <summary>
        /// Get the corresponding AbstractFastTransferStream.
        /// </summary>
        /// <returns>The corresponding AbstractFastTransferStream.</returns>
        public AbstractFastTransferStream GetAbstractFastTransferStream()
        {
            AbstractFastTransferStream abstractFastTransferStream = new AbstractFastTransferStream
            {
                StreamType = FastTransferStreamType.MessageContent
            };

            AbstractMessageContent abstractMessageContent = new AbstractMessageContent();

            if (this.PropList != null && this.PropList.PropValues.Count > 0)
            {
                // Check the propList of MessageContent if one PropValue is a PtypString value, 
                // the StringPropertiesInUnicode of the AbstractMessageContent is true.
                for (int i = 0; i < this.PropList.PropValues.Count; i++)
                {
                    PropValue p = this.PropList.PropValues[i];
                    if (p.PropType == 0x1f)
                    {
                        abstractMessageContent.StringPropertiesInUnicode = true;
                        break;
                    }
                }

                for (int i = 0; i < this.PropList.PropValues.Count; i++)
                {
                    PropValue p = this.PropList.PropValues[i];

                    // If server stored the string using Unicode, the code page property type should be 0x84B0, which specifies the Unicode (1200) code page, specified in section 2.2.4.1.1.1. 
                    if (p.PropType == 0x84b0)
                    {
                        abstractMessageContent.StringPropertiesInUnicodeCodePage = true;
                        break;
                    }
                }

                for (int i = 0; i < this.PropList.PropValues.Count; i++)
                {
                    PropValue p = this.PropList.PropValues[i];

                    // If server supports other formats (not Unicode), the PropType should not be 0X84b0, which specifies the Unicode (1200) code page, specified in section 2.2.4.1.1.1.
                    if (p.PropType - 0x8000 >= 0 && p.PropType != 0x84b0)
                    {
                        abstractMessageContent.StringPropertiesInOtherCodePage = true;
                        break;
                    }
                }
            }
            else if (this.MessageChildren != null)
            {
                // Check the propList of MessageContent if one PropValue is a PtypString value, 
                // the StringPropertiesInUnicode of the AbstractMessageContent is true.
                foreach (Recipient rec in this.MessageChildren.Recipients)
                {
                    if (rec.PropList.HasPropertyType(0x1f))
                    {
                        abstractMessageContent.StringPropertiesInUnicode = true;
                        break;
                    }

                    // If server stored the string using Unicode, the code page property type should be 0x84B0, which specifies the Unicode (1200) code page, specified in section 2.2.4.1.1.1. 
                    if (rec.PropList.HasPropertyType(0x84b0))
                    {
                        abstractMessageContent.StringPropertiesInUnicodeCodePage = true;
                        break;
                    }

                    for (int i = 0; i < rec.PropList.PropValues.Count; i++)
                    {
                        // If server supports other formats (not Unicode), the PropType should not be 0X84b0, which specifies the Unicode (1200) code page, specified in section 2.2.4.1.1.1.
                        if (rec.PropList.PropValues[i].PropType - 0x8000 >= 0 && rec.PropList.PropValues[i].PropType != 0x84b0)
                        {
                            abstractMessageContent.StringPropertiesInOtherCodePage = true;
                            break;
                        }
                    }
                }
            }
            else
            {
                abstractMessageContent.StringPropertiesInUnicode = false;
            }

            if (this.MessageChildren != null)
            {
                // If MessageChildren contains attachments check whether attachments Preceded By PidTagFXDelProp.
                if (this.MessageChildren.Attachments != null && this.MessageChildren.Attachments.Count > 0)
                {
                    abstractMessageContent.AbsMessageChildren.AttachmentPrecededByPidTagFXDelProp
                         = this.MessageChildren.FXDelPropsBeforeAttachment != null
                         && this.MessageChildren.FXDelPropsBeforeAttachment.Count > 0;
                }

                if (this.MessageChildren.Recipients != null && this.MessageChildren.Recipients.Count > 0)
                {
                    abstractMessageContent.AbsMessageChildren.RecipientPrecededByPidTagFXDelProp
                        = this.MessageChildren.FXDelPropsBeforeRecipient != null
                        && this.MessageChildren.FXDelPropsBeforeRecipient.Count > 0;
                }
            }

            abstractFastTransferStream.AbstractMessageContent = abstractMessageContent;
            return abstractFastTransferStream;
        }