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 += 4;
// Only success response has below fields
if (this.ReturnValue == 0)
{
this.HasNamedProperties = ropBytes[index++];
index += this.SubjectPrefix.Deserialize(ropBytes, index);
index += this.NormalizedSubject.Deserialize(ropBytes, index);
this.RecipientCount = (ushort)BitConverter.ToInt16(ropBytes, index);
index += 2;
this.ColumnCount = (ushort)BitConverter.ToInt16(ropBytes, index);
index += 2;
// RecipientColumns
if (this.ColumnCount > 0)
{
this.RecipientColumns = new PropertyTag[this.ColumnCount];
Context.Instance.Init();
for (int i = 0; i < this.ColumnCount; i++)
{
index += this.RecipientColumns[i].Deserialize(ropBytes, index);
Context.Instance.Properties.Add(new Property((PropertyType)this.RecipientColumns[i].PropertyType));
}
}
this.RowCount = ropBytes[index++];
if (this.RowCount > 0)
{
this.RecipientRows = new OpenRecipientRow[this.RowCount];
for (int i = 0; i < this.RowCount; i++)
{
index += this.RecipientRows[i].Deserialize(ropBytes, index);
}
}
}
return index - startIndex;
}
}