Microsoft.Protocols.TestSuites.Common.RopGetReceiveFolderTableResponse.Deserialize C# (CSharp) Method

Deserialize() public method

Deserialize the ROP response buffer.
public Deserialize ( byte ropBytes, int startIndex ) : int
ropBytes byte ROPs bytes in response.
startIndex int The start index of this ROP.
return int
        public int Deserialize(byte[] ropBytes, int startIndex)
        {
            int index = startIndex;
            this.RopId = ropBytes[index++];
            this.InputHandleIndex = ropBytes[index++];
            this.ReturnValue = (uint)BitConverter.ToInt32(ropBytes, index);
            index += sizeof(uint);

            // Only success response has below fields
            if (this.ReturnValue == 0)
            {
                this.RowCount = (uint)BitConverter.ToUInt32(ropBytes, index);
                index += sizeof(uint);
             
                List<Property> properties = new List<Property>();
                Property pidTagFolderId = new Property(PropertyType.PtypInteger64)
                {
                    Name = "PidTagFolderId"
                };
                properties.Add(pidTagFolderId);

                Property pidTagMessageClass = new Property(PropertyType.PtypString8)
                {
                    Name = "PidTagMessageClass"
                };
                properties.Add(pidTagMessageClass);

                Property pidTagLastModificationTime = new Property(PropertyType.PtypTime)
                {
                    Name = "PidTagLastModificationTime"
                };
                properties.Add(pidTagLastModificationTime);

                Context.Instance.Properties = properties;
                Context.Instance.PropertyBytes = ropBytes;
                Context.Instance.CurIndex = index;
                this.Rows = new PropertyRowSet
                {
                    Count = (int)this.RowCount
                };

                // Set row count
                this.Rows.Parse(Context.Instance);

                // Context.Instance.CurIndex indicates the already deserialized bytes' index
                index = Context.Instance.CurIndex;
            }

            return index - startIndex;
        }
    } 
RopGetReceiveFolderTableResponse