Exemple #1
0
 public TypeSerializer(Type type, TypeSerializerBuilder typeSerializerBuilder)
 {
     this.type = type;
     this.typeSerializerBuilder = typeSerializerBuilder;
     this.serializerExpression  = new Lazy <Expression>(this.BuildSerializerExpression);
     this.lazySerializerLambda  =
         new Lazy <Action <StreamWriter, SerializationContext, object> >(this.CompileSerializer);
     this.deserializerExpression = new Lazy <Expression>(this.BuildDeserializerExpression);
     this.lazyDeserializerLambda =
         new Lazy <Func <StreamReader, SerializationContext, object> >(this.CompileDeserializer);
 }
 public TypeSerializer(Type type, TypeSerializerBuilder typeSerializerBuilder)
 {
     this.type = type;
     this.typeSerializerBuilder = typeSerializerBuilder;
     this.serializerExpression = new Lazy<Expression>(this.BuildSerializerExpression);
     this.lazySerializerLambda =
         new Lazy<Action<StreamWriter, SerializationContext, object>>(this.CompileSerializer);
     this.deserializerExpression = new Lazy<Expression>(this.BuildDeserializerExpression);
     this.lazyDeserializerLambda =
         new Lazy<Func<StreamReader, SerializationContext, object>>(this.CompileDeserializer);
 }