Пример #1
0
 private VPack(
     IDictionary <Type, IVPackSerializer> serializers,
     IDictionary <Type, IVPackDeserializer> deserializers,
     IDictionary <Type, IVPackInstanceCreator> instanceCreators,
     VPackBuilder.IBuilderOptions builderOptions,
     bool serializeNullValues,
     IVPackFieldNamingStrategy fieldNamingStrategy,
     IDictionary <string, IDictionary <Type, IVPackDeserializer> > deserializersByName)
 {
     this.serializers         = serializers;
     this.deserializers       = deserializers;
     this.instanceCreators    = instanceCreators;
     this.builderOptions      = builderOptions;
     this.serializeNullValues = serializeNullValues;
     this.deserializersByName = deserializersByName;
     this.keyMapAdapters      = new Dictionary <Type, IVPackKeyMapAdapter>();
     this.cache = new VPackCache(fieldNamingStrategy);
     this.serializationContext               = new _VPackSerializationContext_209(this);
     this.deserializationContext             = new _VPackDeserializationContext_216(this);
     this.keyMapAdapters[typeof(string)]     = VPackKeyMapAdapters.STRING;
     this.keyMapAdapters[typeof(bool)]       = VPackKeyMapAdapters.BOOLEAN;
     this.keyMapAdapters[typeof(int)]        = VPackKeyMapAdapters.INTEGER;
     this.keyMapAdapters[typeof(long)]       = VPackKeyMapAdapters.LONG;
     this.keyMapAdapters[typeof(short)]      = VPackKeyMapAdapters.SHORT;
     this.keyMapAdapters[typeof(double)]     = VPackKeyMapAdapters.DOUBLE;
     this.keyMapAdapters[typeof(float)]      = VPackKeyMapAdapters.FLOAT;
     this.keyMapAdapters[typeof(BigInteger)] = VPackKeyMapAdapters.BIG_INTEGER;
     this.keyMapAdapters[typeof(decimal)]    = VPackKeyMapAdapters.NUMBER;
     this.keyMapAdapters[typeof(char)]       = VPackKeyMapAdapters.CHARACTER;
 }
Пример #2
0
 /// <exception cref="VPackException"/>
 public override void Serialize(
     VPackBuilder builder,
     string attribute,
     short value,
     IVPackSerializationContext context)
 {
     builder.Add(attribute, value);
 }
Пример #3
0
 void IVPackSerializer.Serialize(VPackBuilder builder, string attribute, object value, IVPackSerializationContext context)
 {
     Serialize(builder, attribute, (T)value, context);
 }
Пример #4
0
 /// <exception cref="VPackException"/>
 public abstract void Serialize(VPackBuilder builder, string attribute, T value, IVPackSerializationContext context);