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

            _name = property.Name;
        }
コード例 #3
0
        public YamlElementParser(TypeSerializer <TElement> elementTypeSerializer)
        {
            ElementTypeSerializer = elementTypeSerializer;
            ElementWriter         = ElementTypeSerializer.GetWriter();
            ElementReader         = ElementTypeSerializer.GetReader();

            StringReader = new YamlStringSerializer().GetReader();
        }
コード例 #4
0
        public FastTextElementParser(TypeSerializer <TElement> elementTypeSerializer)
        {
            ElementTypeSerializer = elementTypeSerializer;
            ElementWriter         = ElementTypeSerializer.GetWriter();
            ElementReader         = ElementTypeSerializer.GetReader();

            StringReader = new FastTextStringSerializer().GetReader();
        }
コード例 #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;
            });
        }
コード例 #6
0
 public NullableSerializer(TypeSerializer <T> serializer)
 {
     _serializer = serializer;
     _reader     = _serializer.GetReader();
     _writer     = _serializer.GetWriter();
 }