Ejemplo n.º 1
0
        private ObjectSerializerBase BuildRecordTypeSchema(Type type, uint currentDepth)
        {
            var record = ClassSerializer.Create(type);

            this.seenTypes.Add(type, record);

            var members = type.ResolveMembers();

            foreach (var info in members)
            {
                ObjectSerializerBase fieldSchema = CreateSchema(info.Type, currentDepth + 1);

                var recordField = new RecordFieldSerializer(fieldSchema, info);
                record.AddField(recordField);
            }

            return(record);
        }
Ejemplo n.º 2
0
 public MultidimensionalArraySerializer(ObjectSerializerBase item, Type runtimeType) : base(runtimeType) => this.ItemSchema = item;
Ejemplo n.º 3
0
        public static ObjectSerializerBase Create(Type collectionType, Type itemType, ObjectSerializerBase itemSerializer)
        {
            var serializerType = typeof(EnumerableSerializer <,>).MakeGenericType(collectionType, itemType);

            return((ObjectSerializerBase)Activator.CreateInstance(serializerType, itemSerializer));
        }
Ejemplo n.º 4
0
 public RecordFieldSerializer(ObjectSerializerBase schema, MyFieldInfo info)
 {
     this.Schema     = schema;
     this.MemberInfo = info;
 }