private void WriteStructTypeValue(RSBinaryWriter _binaryWriter, object _object, Type _objectType) { // Register object graph type UInt32 _objectTypeID; bool _newType; TypeMetadata.RegisterType(_objectType, out _objectTypeID, out _newType); if (_newType) { TypeMetadata.WriteTypeMetadata(_binaryWriter, _objectType, _objectTypeID); } // Write object properties _binaryWriter.WriteBinaryElement(BinaryElement.OBJECT_DATA); _binaryWriter.WriteTypeTag(eTypeTag.STRUCT); _binaryWriter.Write(_objectTypeID); // Write object graph WriteObjectGraph(_binaryWriter, _object, _objectType); }