Esempio n. 1
0
 public YamlKeyElementParser(TypeSerializer <TKey> keyTypeSerializer, TypeSerializer <TElement> elementTypeSerializer)
     : base(elementTypeSerializer)
 {
     KeyTypeSerializer = keyTypeSerializer;
     KeyWriter         = KeyTypeSerializer.GetWriter();
     KeyReader         = KeyTypeSerializer.GetReader();
 }
Esempio n. 2
0
        public YamlPropertySerializer(TypeSerializer <T> serializer, PropertyInfo property)
        {
            _writer = serializer.GetWriter();
            _reader = serializer.GetReader();

            _name = property.Name;
        }
Esempio n. 3
0
        public YamlElementParser(TypeSerializer <TElement> elementTypeSerializer)
        {
            ElementTypeSerializer = elementTypeSerializer;
            ElementWriter         = ElementTypeSerializer.GetWriter();
            ElementReader         = ElementTypeSerializer.GetReader();

            StringReader = new YamlStringSerializer().GetReader();
        }
Esempio n. 4
0
        public FastTextElementParser(TypeSerializer <TElement> elementTypeSerializer)
        {
            ElementTypeSerializer = elementTypeSerializer;
            ElementWriter         = ElementTypeSerializer.GetWriter();
            ElementReader         = ElementTypeSerializer.GetReader();

            StringReader = new FastTextStringSerializer().GetReader();
        }
Esempio n. 5
0
        public TypeReader <Type> GetReader()
        {
            TypeReader <Type>   typeReader   = _typeSerializer.GetReader();
            TypeReader <string> stringReader = _stringSerializer.GetReader();

            return(value =>
            {
                string typeString = stringReader(value);

                Type typeValue = typeReader(typeString);

                return typeValue;
            });
        }
Esempio n. 6
0
 public NullableSerializer(TypeSerializer <T> serializer)
 {
     _serializer = serializer;
     _reader     = _serializer.GetReader();
     _writer     = _serializer.GetWriter();
 }