/// <summary>
        /// Parse the RopAbortSubmitRequest structure.
        /// </summary>
        /// <param name="s">An stream containing RopAbortSubmitRequest structure.</param>
        public override void Parse(Stream s)
        {
            base.Parse(s);

            this.RopId = (RopIdType)ReadByte();
            this.LogonId = ReadByte();
            this.InputHandleIndex = ReadByte();
            this.FolderId = new FolderID();
            this.FolderId.Parse(s);
            this.MessageId = new MessageID();
            this.MessageId.Parse(s);
        }
 /// <summary>
 /// Parse the PtypServerId structure.
 /// </summary>
 /// <param name="s">A stream containing the PtypServerId structure</param>
 public override void Parse(Stream s)
 {
     base.Parse(s);
     this.Count = ReadUshort();
     this.Ours = ReadByte();
     if (this.Ours == 0x01)
     {
         this.FolderID = new FolderID();
         this.FolderID.Parse(s);
         this.MessageID = new MessageID();
         this.MessageID.Parse(s);
         this.Instance = ReadUint();
     }
     else
     {
         this.ClientData = ConvertArray(ReadBytes(this.Count - 1));
     }
 }
        /// <summary>
        /// Parse the RopGetTransportFolderResponse structure.
        /// </summary>
        /// <param name="s">An stream containing RopGetTransportFolderResponse structure.</param>
        public override void Parse(Stream s)
        {
            base.Parse(s);

            this.RopId = (RopIdType)ReadByte();
            this.InputHandleIndex = ReadByte();
            HelpMethod help = new HelpMethod();
            this.ReturnValue = help.FormatErrorCode(ReadUint());

            if ((ErrorCodes)ReturnValue == ErrorCodes.Success)
            {
                this.FolderId = new FolderID();
                this.FolderId.Parse(s);
            }
        }
        /// <summary>
        /// Parse the RopTransportNewMailRequest structure.
        /// </summary>
        /// <param name="s">An stream containing RopTransportNewMailRequest structure.</param>
        public override void Parse(Stream s)
        {
            base.Parse(s);

            this.RopId = (RopIdType)ReadByte();
            this.LogonId = ReadByte();
            this.InputHandleIndex = ReadByte();
            this.MessageId = new MessageID();
            this.MessageId.Parse(s);
            this.FolderId = new FolderID();
            this.FolderId.Parse(s);
            this.MessageClass = new MAPIString(Encoding.ASCII);
            this.MessageClass.Parse(s);
            this.MessageFlags = (MessageFlags)ReadUint();
        }
        /// <summary>
        /// Parse the RopRegisterNotificationRequest structure.
        /// </summary>
        /// <param name="s">An stream containing RopRegisterNotificationRequest structure.</param>
        public override void Parse(Stream s)
        {
            base.Parse(s);

            this.RopId = (RopIdType)ReadByte();
            this.LogonId = ReadByte();
            this.InputHandleIndex = ReadByte();
            this.OutputHandleIndex = ReadByte();
            this.NotificationTypes = (NotificationTypesEnum)ReadUshort();
            if (this.NotificationTypes == NotificationTypesEnum.Extended)
            {
                this.Reserved = ReadByte();
            }
            this.WantWholeStore = ReadBoolean();
            if (!this.WantWholeStore)
            {
                this.FolderId = new FolderID();
                this.FolderId.Parse(s);
                this.MessageId = new MessageID();
                this.MessageId.Parse(s);
            }
        }
        /// <summary>
        /// Parse the RopLogonResponse_PublicFolders structure.
        /// </summary>
        /// <param name="s">An stream containing RopLogonResponse_PublicFolders structure.</param>
        public override void Parse(Stream s)
        {
            base.Parse(s);

            this.RopId = (RopIdType)ReadByte();
            this.OutputHandleIndex = ReadByte();
            HelpMethod help = new HelpMethod();
            this.ReturnValue = help.FormatErrorCode(ReadUint());
            if ((ErrorCodes)ReturnValue == ErrorCodes.Success)
            {
                this.LogonFlags = (LogonFlags)ReadByte();
                this.FolderIds = new FolderID[13];
                for (int i = 0; i < 13; i++)
                {
                    FolderIds[i] = new FolderID();
                    FolderIds[i].Parse(s);
                }
                this.ReplId = ReadUshort();
                this.ReplGuid = ReadGuid();
                this.PerUserGuid = ReadGuid();
            }
            else if ((AdditionalErrorCodes)ReturnValue == AdditionalErrorCodes.WrongServer)
            {
                this.LogonFlags = (LogonFlags)ReadByte();
                this.ServerNameSize = ReadByte();
                this.ServerName = new MAPIString(Encoding.ASCII);
                this.ServerName.Parse(s);
            }
        }
 /// <summary>
 /// Parse the RopCreateMessageRequest structure.
 /// </summary>
 /// <param name="s">An stream containing RopCreateMessageRequest structure.</param>
 public override void Parse(Stream s)
 {
     base.Parse(s);
     this.RopId = (RopIdType)ReadByte();
     this.LogonId = ReadByte();
     this.InputHandleIndex = ReadByte();
     this.OutputHandleIndex = ReadByte();
     this.CodePageId = ReadUshort();
     this.FolderId = new FolderID();
     this.FolderId.Parse(s);
     this.AssociatedFlag = ReadBoolean();
 }
        /// <summary>
        /// Parse the NotificationData structure.
        /// </summary>
        /// <param name="s">An stream containing NotificationData structure.</param>
        public override void Parse(Stream s)
        {
            base.Parse(s);
            this.NotificationFlags = new NotificationFlags();
            this.NotificationFlags.Parse(s);
            if (this.NotificationFlags.Value.NotificationType == NotificationTypesEnum.TableModified)
            {
                this.TableEventType = (TableEventTypeEnum)ReadUshort();
            }
            if (NotificationFlags.Value.NotificationType == NotificationTypesEnum.TableModified && (TableEventType == TableEventTypeEnum.TableRowAdded || TableEventType == TableEventTypeEnum.TableRowDeleted || TableEventType == TableEventTypeEnum.TableRowModified))
            {
                this.TableRowFolderID = new FolderID();
                this.TableRowFolderID.Parse(s);
            }
            if ((((int)NotificationFlags.Value.NotificationDataAvailability & 0x8000) != 0) && (TableEventType == TableEventTypeEnum.TableRowAdded || TableEventType == TableEventTypeEnum.TableRowDeleted || TableEventType == TableEventTypeEnum.TableRowModified))
            {
                this.TableRowMessageID = new MessageID();
                this.TableRowMessageID.Parse(s);
            }
            if ((((int)NotificationFlags.Value.NotificationDataAvailability & 0x8000) != 0) && (TableEventType == TableEventTypeEnum.TableRowAdded || TableEventType == TableEventTypeEnum.TableRowDeleted || TableEventType == TableEventTypeEnum.TableRowModified))
            {
                this.TableRowInstance = ReadUint();
            }
            if (NotificationFlags.Value.NotificationType == NotificationTypesEnum.TableModified && (TableEventType == TableEventTypeEnum.TableRowAdded || TableEventType == TableEventTypeEnum.TableRowModified))
            {
                this.InsertAfterTableRowFolderID = new FolderID();
                this.InsertAfterTableRowFolderID.Parse(s);
            }
            if (NotificationFlags.Value.NotificationType == NotificationTypesEnum.TableModified && (((int)NotificationFlags.Value.NotificationDataAvailability & 0x8000) != 0) && (TableEventType == TableEventTypeEnum.TableRowAdded || TableEventType == TableEventTypeEnum.TableRowModified))
            {
                this.InsertAfterTableRowID = new MessageID();
                this.InsertAfterTableRowID.Parse(s);
            }
            if (NotificationFlags.Value.NotificationType == NotificationTypesEnum.TableModified && (((int)NotificationFlags.Value.NotificationDataAvailability & 0x8000) != 0) && (TableEventType == TableEventTypeEnum.TableRowAdded || TableEventType == TableEventTypeEnum.TableRowModified))
            {
                this.InsertAfterTableRowInstance = ReadUint();
            }
            if (NotificationFlags.Value.NotificationType == NotificationTypesEnum.TableModified && (TableEventType == TableEventTypeEnum.TableRowAdded || TableEventType == TableEventTypeEnum.TableRowModified))
            {
                this.TableRowDataSize = ReadUshort();
            }
            if (NotificationFlags.Value.NotificationType == NotificationTypesEnum.TableModified && (TableEventType == TableEventTypeEnum.TableRowAdded || TableEventType == TableEventTypeEnum.TableRowModified))
            {
                if (DecodingContext.SetColumnProTagMap_Handle != null && DecodingContext.SetColumnProTagMap_Handle.ContainsKey(this.NotificationHandle) )
                {
                    propertiesBySetColum = DecodingContext.SetColumnProTagMap_Handle[this.NotificationHandle];
                }
                else
                {
                    throw new MissingInformationException("Missing PropertyTags information for RopNotifyResponse", (ushort)RopIdType.RopNotify, new uint[] {0,NotificationHandle });
                }
                this.TableRowData = new PropertyRow(propertiesBySetColum);
                this.TableRowData.Parse(s);
            }
            if (NotificationFlags.Value.NotificationType != NotificationTypesEnum.TableModified && NotificationFlags.Value.NotificationType != NotificationTypesEnum.Extended)
            {

                this.FolderId = new FolderID();
                this.FolderId.Parse(s);
            }
            if (NotificationFlags.Value.NotificationType != NotificationTypesEnum.TableModified && NotificationFlags.Value.NotificationType != NotificationTypesEnum.Extended && (((int)NotificationFlags.Value.NotificationDataAvailability & 0x8000) != 0))
            {
                this.MessageId = new MessageID();
                this.MessageId.Parse(s);
            }
            if ((NotificationFlags.Value.NotificationType == NotificationTypesEnum.ObjectCreated || NotificationFlags.Value.NotificationType == NotificationTypesEnum.ObjectDeleted || NotificationFlags.Value.NotificationType == NotificationTypesEnum.ObjectMoved || NotificationFlags.Value.NotificationType == NotificationTypesEnum.ObjectCopied) && ((((int)NotificationFlags.Value.NotificationDataAvailability) & 0xC000) == 0xC000 || (((int)NotificationFlags.Value.NotificationDataAvailability) & 0xC000) == 0))
            {
                this.ParentFolderId = new FolderID();
                this.ParentFolderId.Parse(s);
            }
            if (NotificationFlags.Value.NotificationType == NotificationTypesEnum.ObjectMoved || NotificationFlags.Value.NotificationType == NotificationTypesEnum.ObjectCopied)
            {

                this.OldFolderId = new FolderID();
                this.OldFolderId.Parse(s);
            }
            if ((NotificationFlags.Value.NotificationType == NotificationTypesEnum.ObjectMoved || NotificationFlags.Value.NotificationType == NotificationTypesEnum.ObjectCopied) && (((int)NotificationFlags.Value.NotificationDataAvailability & 0x8000) != 0))
            {
                this.OldMessageId = new MessageID();
                this.OldMessageId.Parse(s);
            }
            if ((NotificationFlags.Value.NotificationType == NotificationTypesEnum.ObjectMoved || NotificationFlags.Value.NotificationType == NotificationTypesEnum.ObjectCopied) && (((int)NotificationFlags.Value.NotificationDataAvailability & 0x8000) == 0))
            {
                this.OldParentFolderId = new MessageID();
                this.OldParentFolderId.Parse(s);
            }
            if (NotificationFlags.Value.NotificationType == NotificationTypesEnum.ObjectCreated || NotificationFlags.Value.NotificationType == NotificationTypesEnum.ObjectModified)
            {
                this.TagCount = ReadUshort();
                if (TagCount != 0x0000 && TagCount != 0xFFFF)
                {
                    List<PropertyTag> listTags = new List<PropertyTag>();
                    for (int i = 0; i < this.TagCount; i++)
                    {
                        PropertyTag tempTag = new PropertyTag();
                        tempTag.Parse(s);
                        listTags.Add(tempTag);
                    }
                    this.Tags = listTags.ToArray();
                }
            }
            if (((int)NotificationFlags.Value.NotificationDataAvailability & 0x1000) != 0)
            {
                this.TotalMessageCount = ReadUint();
            }
            if (((int)NotificationFlags.Value.NotificationDataAvailability & 0x2000) != 0)
            {
                this.UnreadMessageCount = ReadUint();
            }
            if (NotificationFlags.Value.NotificationType == NotificationTypesEnum.NewMail)
            {
                this.MessageFlags = ReadUint();
                this.UnicodeFlag = ReadByte();
                this.MessageClass = new MAPIString(Encoding.ASCII);
                this.MessageClass.Parse(s);
            }
        }
        /// <summary>
        /// Parse the RopGetSearchCriteriaResponse structure.
        /// </summary>
        /// <param name="s">An stream containing RopGetSearchCriteriaResponse structure.</param>
        public override void Parse(Stream s)
        {
            base.Parse(s);

            this.RopId = (RopIdType)ReadByte();
            this.InputHandleIndex = ReadByte();
            HelpMethod help = new HelpMethod();
            this.ReturnValue = help.FormatErrorCode(ReadUint());

            if ((ErrorCodes)ReturnValue == ErrorCodes.Success)
            {
                this.RestrictionDataSize = ReadUshort();
                if (RestrictionDataSize > 0)
                {
                    this.RestrictionData = new RestrictionType();
                    this.RestrictionData.Parse(s);
                }
                this.LogonId = ReadByte();
                this.FolderIdCount = ReadUshort();
                List<FolderID> tempFolderIDs = new List<FolderID>();
                for (int i = 0; i < FolderIdCount; i++)
                {
                    FolderID folderID = new FolderID();
                    folderID.Parse(s);
                    tempFolderIDs.Add(folderID);
                }
                this.FolderIds = tempFolderIDs.ToArray();
                this.SearchFlags = (SearchResponseFlags)ReadUint();
            }
        }
 /// <summary>
 /// Parse the RopOpenMessageRequest structure.
 /// </summary>
 /// <param name="s">An stream containing RopOpenMessageRequest structure.</param>
 public override void Parse(Stream s)
 {
     base.Parse(s);
     this.RopId = (RopIdType)ReadByte();
     this.LogonId = ReadByte();
     this.InputHandleIndex = ReadByte();
     this.OutputHandleIndex = ReadByte();
     this.CodePageId = ReadINT16();
     this.FolderId = new FolderID();
     this.FolderId.Parse(s);
     this.OpenModeFlags = (OpenMessageModeFlags)ReadByte();
     this.MessageId = new MessageID();
     this.MessageId.Parse(s);
 }
        /// <summary>
        /// Parse the RopDeleteFolderRequest structure.
        /// </summary>
        /// <param name="s">An stream containing RopDeleteFolderRequest structure.</param>
        public override void Parse(Stream s)
        {
            base.Parse(s);

            this.RopId = (RopIdType)ReadByte();
            this.LogonId = ReadByte();
            this.InputHandleIndex = ReadByte();
            this.DeleteFolderFlags = (DeleteFolderFlags)ReadByte();
            this.FolderId = new FolderID();
            this.FolderId.Parse(s);
        }
        /// <summary>
        /// Parse the RopCreateFolderResponse structure.
        /// </summary>
        /// <param name="s">An stream containing RopCreateFolderResponse structure.</param>
        public override void Parse(Stream s)
        {
            base.Parse(s);

            this.RopId = (RopIdType)ReadByte();
            this.OutputHandleIndex = ReadByte();
            HelpMethod help = new HelpMethod();
            this.ReturnValue = help.FormatErrorCode(ReadUint());

            if ((ErrorCodes)ReturnValue == ErrorCodes.Success)
            {
                this.FolderId = new FolderID();
                this.FolderId.Parse(s);
                this.IsExistingFolder = ReadBoolean();
                if ((bool)IsExistingFolder)
                {
                    this.HasRules = ReadBoolean();
                    this.IsGhosted = ReadBoolean();
                    if ((bool)IsGhosted)
                    {
                        this.ServerCount = ReadUshort();
                        this.CheapServerCount = ReadUshort();
                        List<MAPIString> tempServers = new List<MAPIString>();
                        for (int i = 0; i < ServerCount; i++)
                        {
                            MAPIString tempString = new MAPIString(Encoding.ASCII);
                            tempString.Parse(s);
                            tempServers.Add(tempString);
                        }
                        this.Servers = tempServers.ToArray();
                    }
                }
            }
        }
        /// <summary>
        /// Parse the RopSetSearchCriteriaRequest structure.
        /// </summary>
        /// <param name="s">An stream containing RopSetSearchCriteriaRequest structure.</param>
        public override void Parse(Stream s)
        {
            base.Parse(s);

            this.RopId = (RopIdType)ReadByte();
            this.LogonId = ReadByte();
            this.InputHandleIndex = ReadByte();
            this.RestrictionDataSize = ReadUshort();
            if (RestrictionDataSize > 0)
            {
                this.RestrictionData = new RestrictionType();
                this.RestrictionData.Parse(s);
            }
            this.FolderIdCount = ReadUshort();
            List<FolderID> tempFolderIDs = new List<FolderID>();
            for (int i = 0; i < FolderIdCount; i++)
            {
                FolderID folderID = new FolderID();
                folderID.Parse(s);
                tempFolderIDs.Add(folderID);
            }
            this.FolderIds = tempFolderIDs.ToArray();
            this.SearchFlags = (SearchRequestFlags)ReadUint();
        }
        /// <summary>
        /// Parse the RopCopyFolderRequest structure.
        /// </summary>
        /// <param name="s">An stream containing RopCopyFolderRequest structure.</param>
        public override void Parse(Stream s)
        {
            base.Parse(s);

            this.RopId = (RopIdType)ReadByte();
            this.LogonId = ReadByte();
            this.SourceHandleIndex = ReadByte();
            this.DestHandleIndex = ReadByte();
            this.WantAsynchronous = ReadBoolean();
            this.WantRecursive = ReadBoolean();
            this.UseUnicode = ReadBoolean();
            this.FolderId = new FolderID();
            this.FolderId.Parse(s);
            if (UseUnicode)
            {
                this.NewFolderName = new MAPIString(Encoding.Unicode);
                this.NewFolderName.Parse(s);
            }
            else
            {
                this.NewFolderName = new MAPIString(Encoding.ASCII);
                this.NewFolderName.Parse(s);
            }
        }
        /// <summary>
        /// Parse the RopOpenFolderRequest structure.
        /// </summary>
        /// <param name="s">An stream containing RopOpenFolderRequest structure.</param>
        public override void Parse(Stream s)
        {
            base.Parse(s);

            this.RopId = (RopIdType)ReadByte();
            this.LogonId = ReadByte();
            this.InputHandleIndex = ReadByte();
            this.OutputHandleIndex = ReadByte();
            this.FolderId = new FolderID();
            this.FolderId.Parse(s);
            this.OpenModeFlags = (OpenModeFlagsMSOXCFOLD)ReadByte();
        }