/// <summary>
        /// Parse the OrRestriction structure.
        /// </summary>
        /// <param name="s">A stream containing the OrRestriction structure</param>
        public override void Parse(Stream s)
        {
            base.Parse(s);
            this.RestrictType = (RestrictTypeEnum)ReadByte();
            if (countWide == CountWideEnum.twoBytes)
            {
                this.RestrictCount = ReadUshort();
            }
            else
            {
                this.RestrictCount = ReadUint();
            }
            List<RestrictionType> tempRestricts = new List<RestrictionType>();
            for (int length = 0; length < (int)RestrictCount; length++)
            {
                RestrictionType tempRestriction = new RestrictionType();
                tempRestriction.Parse(s);
                tempRestricts.Add(tempRestriction);

            }
            this.Restricts = tempRestricts.ToArray();
        }
 /// <summary>
 /// Parse the SubObjectRestriction structure.
 /// </summary>
 /// <param name="s">A stream containing the SubObjectRestriction structure</param>
 public override void Parse(Stream s)
 {
     base.Parse(s);
     this.RestrictType = (RestrictTypeEnum)ReadByte();
     this.Subobject = ReadUint();
     this.Restriction = new RestrictionType();
     this.Restriction.Parse(s);
 }
        /// <summary>
        /// Parse the RopFindRow structure.
        /// </summary>
        /// <param name="s">An stream containing RopFindRow structure.</param>
        public override void Parse(Stream s)
        {
            base.Parse(s);

            this.RopId = (RopIdType)ReadByte();
            this.LogonId = ReadByte();
            this.InputHandleIndex = ReadByte();
            this.FindRowFlags = (FindRowFlags)ReadByte();
            this.RestrictionDataSize = ReadUshort();
            if (RestrictionDataSize > 0)
            {
                RestrictionType tempRestriction = new RestrictionType();
                this.RestrictionData = tempRestriction;
                this.RestrictionData.Parse(s);
            }
            this.Origin = (Bookmarks)ReadByte();
            this.BookmarkSize = ReadUshort();
            this.Bookmark = ReadBytes(BookmarkSize);
        }
 /// <summary>
 /// Parse the CommentRestriction structure.
 /// </summary>
 /// <param name="s">A stream containing the CommentRestriction structure</param>
 public override void Parse(Stream s)
 {
     base.Parse(s);
     this.RestrictType = (RestrictTypeEnum)ReadByte();
     this.TaggedValuesCount = ReadByte();
     List<TaggedPropertyValue> tempTaggedValue = new List<TaggedPropertyValue>();
     for (int i = 0; i < this.TaggedValuesCount; i++)
     {
         TaggedPropertyValue tempproperty = new TaggedPropertyValue();
         tempproperty.Parse(s);
         tempTaggedValue.Add(tempproperty);
     }
     this.TaggedValues = tempTaggedValue.ToArray();
     this.RestrictionPresent = ReadBoolean();
     if (this.RestrictionPresent == true)
     {
         this.Restriction = new RestrictionType();
         this.Restriction.Parse(s);
     }
 }
        /// <summary>
        /// Parse the RopRestrictRequest structure.
        /// </summary>
        /// <param name="s">An stream containing RopRestrictRequest structure.</param>
        public override void Parse(Stream s)
        {
            base.Parse(s);

            this.RopId = (RopIdType)ReadByte();
            this.LogonId = ReadByte();
            this.InputHandleIndex = ReadByte();
            this.RestrictFlags = (AsynchronousFlags)ReadByte();
            this.RestrictionDataSize = ReadUshort();
            if (this.RestrictionDataSize > 0)
            {
                RestrictionType restriction = new RestrictionType();
                this.RestrictionData = restriction;
                this.RestrictionData.Parse(s);
            }
        }
        /// <summary>
        /// Parse the RopSynchronizationConfigureRequest structure.
        /// </summary>
        /// <param name="s">An stream containing RopSynchronizationConfigureRequest 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.SynchronizationType = (SynchronizationType)ReadByte();
            this.SendOptions = (SendOptions)ReadByte();
            this.SynchronizationFlags = (SynchronizationFlags)ReadUshort();
            this.RestrictionDataSize = ReadUshort();

            if (RestrictionDataSize > 0)
            {
                this.RestrictionData = new RestrictionType();
                this.RestrictionData.Parse(s);
            }
            this.SynchronizationExtraFlags = (SynchronizationExtraFlags)ReadUint();
            this.PropertyTagCount = ReadUshort();
            PropertyTag[] InterTag = new PropertyTag[(int)this.PropertyTagCount];
            for (int i = 0; i < this.PropertyTagCount; i++)
            {
                InterTag[i] = new PropertyTag();
                InterTag[i].Parse(s);
            }
            this.PropertyTags = InterTag;
        }
        /// <summary>
        /// Parse the GetMatchesRequest structure.
        /// </summary>
        /// <param name="s">An stream containing GetMatchesRequest structure.</param>
        public override void Parse(Stream s)
        {
            base.Parse(s);
            this.Reserved = ReadUint();
            this.HasState = ReadBoolean();
            if (this.HasState)
            {
                STAT stat = new STAT();
                stat.Parse(s);
                this.State = stat;
            }

            this.HasMinimalIds = ReadBoolean();
            if (this.HasMinimalIds)
            {
                this.MinimalIdCount = ReadUint();
                List<MinimalEntryID> me = new List<MinimalEntryID>();
                for (int i = 0; i < this.MinimalIdCount; i++)
                {
                    MinimalEntryID mEntryId = new MinimalEntryID();
                    mEntryId.Parse(s);
                    me.Add(mEntryId);
                }
                this.MinimalIds = me.ToArray();
            }

            this.InterfaceOptionFlags = ReadUint();

            this.HasFilter = ReadBoolean();
            if (this.HasFilter)
            {
                RestrictionType restriction = new RestrictionType();
                restriction.Parse(s);
                this.Filter = restriction;
            }

            this.HasPropertyName = ReadBoolean();
            if (this.HasPropertyName)
            {
                this.PropertyNameGuid = ReadGuid();
                this.PropertyNameId = ReadUint();
            }

            this.RowCount = ReadUint();
            this.HasColumns = ReadBoolean();
            if (this.HasColumns)
            {
                LargePropertyTagArray largePTA = new LargePropertyTagArray();
                largePTA.Parse(s);
                this.Columns = largePTA;
            }

            this.AuxiliaryBufferSize = ReadUint();
            if (this.AuxiliaryBufferSize > 0)
            {
                this.AuxiliaryBuffer = new ExtendedBuffer();
                this.AuxiliaryBuffer.Parse(s);
            }
            else
            {
                this.AuxiliaryBuffer = null;
            }
        }
        /// <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 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();
        }