Microsoft.Protocols.TestSuites.Common.RopSynchronizationImportMessageChangeRequest.Serialize C# (CSharp) Method

Serialize() public method

Serialize the RopSynchronizationImportMessageChange request buffer
public Serialize ( ) : byte[]
return byte[]
        public byte[] Serialize()
        {
            // 0 indicates start index
            int index = 0;
            byte[] serializedBuffer = new byte[this.Size()];

            serializedBuffer[index++] = this.RopId;
            serializedBuffer[index++] = this.LogonId;
            serializedBuffer[index++] = this.InputHandleIndex;
            serializedBuffer[index++] = this.OutputHandleIndex;
            serializedBuffer[index++] = this.ImportFlag;

            Array.Copy(BitConverter.GetBytes((ushort)this.PropertyValueCount), 0, serializedBuffer, index, sizeof(ushort));
            index += sizeof(ushort);
            for (int i = 0; i < this.PropertyValueCount; i++)
            {
                if (this.PropertyValues[i].Value != null)
                {
                    Array.Copy(this.PropertyValues[i].Serialize(), 0, serializedBuffer, index, this.PropertyValues[i].Size());
                    index += this.PropertyValues[i].Size();
                }
            }
                                                                                                                                                                                                
            return serializedBuffer;
        }
RopSynchronizationImportMessageChangeRequest