Exemple #1
0
        public override string Encode(string input, VM vm)
        {
            object obj = JsonConvert.DeserializeObject(input);

            obj = JsonToWatson(obj);
            return(WatsonGen.Generate(obj, vm));
        }
Exemple #2
0
        public override void Encode(StreamReader reader, StreamWriter writer, VM vm)
        {
            var    deserializer = new DeserializerBuilder().Build();
            object obj          = deserializer.Deserialize <object>(reader);

            obj = YamlToWatson(obj);
            WatsonGen.Generate(writer, obj, vm);
        }
Exemple #3
0
        public override string Encode(string input, VM vm)
        {
            var    deserializer = new DeserializerBuilder().Build();
            object obj          = deserializer.Deserialize <object>(input);

            obj = YamlToWatson(obj);
            return(WatsonGen.Generate(obj, vm));
        }
Exemple #4
0
        public override void Encode(StreamReader reader, StreamWriter writer, VM vm)
        {
            var    serializer = JsonSerializer.CreateDefault();
            object obj        = serializer.Deserialize(reader, typeof(object));

            obj = JsonToWatson(obj);
            WatsonGen.Generate(writer, obj, vm);
        }