public override void Serialize( BsonWriter bsonWriter, Type nominalType, object value, IBsonSerializationOptions options) { var size = (System.Drawing.Size)value; bsonWriter.WriteStartDocument(); bsonWriter.WriteInt32("Width", size.Width); bsonWriter.WriteInt32("Height", size.Height); bsonWriter.WriteEndDocument(); } }