private void WriteComplex(ref GraphContext context)
{
WriteObjectTypeCode(context.TypeCode);
Output.Write(context.Descriptor.TypeId);
var serializable = context.Graph as ICustomSerializable;
if(serializable != null)
{
serializable.Write(this);
}
else
{
Output.Write((byte)context.Descriptor.Properties.Count);
foreach(var property in context.Descriptor.Properties)
{
Output.Write(property.PropertyId);
WriteDescendant(property.GetValue(context.Graph));
}
}
}