Microsoft.Protocols.TestSuites.Common.RopFindRowResponse.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.RowNoLongerVisible = ropBytes[index++];
                this.HasRowData = ropBytes[index++];
                if (this.HasRowData != 0)
                {
                    // Parse RowData
                    // Add RowData bytes into Context
                    Context.Instance.PropertyBytes = ropBytes;
                    Context.Instance.CurIndex = index;

                    // Allocate PropretyRowSetNode to parse RowData
                    this.RowData = new PropertyRow();

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

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

            return index - startIndex;
        }
    }
RopFindRowResponse