예제 #1
0
        public override object Deserialize(ContextDeserialization context)
        {
            var isTrue = context.ReadString(4) == "true";

            if (isTrue)
            {
                context.Burn(4);
                return(true);
            }
            var isFalse = context.ReadString(5) == "false";

            if (isFalse)
            {
                context.Burn(5);
                return(false);
            }
            throw new Exception("Json unknown token: " + context.ReadString(1));
        }
예제 #2
0
        public override object Deserialize(ContextDeserialization context)
        {
            var value = context.ReadString(4);

            if (value == "null")
            {
                context.Burn(4);
                return(null);
            }
            throw new Exception("Json unknown token: " + value);
        }