예제 #1
0
        public Deserializer CreateDeserializer(Type t)
        {
            Deserializer deserializer;

              var builder = new TreeBuilder(_converter);

              var generator = new DeserializeCodeGenerator(builder);

              var knownTypeDel = builder.TryGetKnownTypeDelegate(t);

              if (knownTypeDel == null)
              {
            var root = builder.CreateTree(t);

            var del = generator.Generate(root);

            deserializer = new Deserializer { Method = del };
              }
              else
              {
            deserializer = new Deserializer { Method = knownTypeDel };
              }

              return deserializer;
        }
예제 #2
0
 public DeserializeCodeGenerator(TreeBuilder builder)
 {
     _treeBuilder = builder;
 }