Microsoft.Protocols.TestSuites.Common.PropertyTag.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.PropertyType = (ushort)BitConverter.ToInt16(ropBytes, index);
            index += sizeof(ushort);
            this.PropertyId = (ushort)BitConverter.ToInt16(ropBytes, index);
            index += sizeof(ushort);
            return index - startIndex;
        }

Usage Example

 /// <summary>
 /// Parse bytes in context into TaggedPropertyValueNode
 /// </summary>
 /// <param name="context">The value of Context</param>
 public override void Parse(Context context)
 {
     // Parse PropertyType and assign it to context's current PropertyType
     Microsoft.Protocols.TestSuites.Common.PropertyTag p = new PropertyTag();
     context.CurIndex += p.Deserialize(context.PropertyBytes, context.CurIndex);
     context.CurProperty.Type = (PropertyType)p.PropertyType;
     this.PropertyTag = p;
     base.Parse(context);
 }
All Usage Examples Of Microsoft.Protocols.TestSuites.Common.PropertyTag::Deserialize