Esempio n. 1
0
        public override void Deserialise(ref object to, object[] values, ref int i)
        {
            object val = Deserialiser <T> .Deserialise(values, ref i);

            if (!value.Equals(val))
            {
                throw new InvalidTypeException($"Expected type {typeof(T)} but instead got {val.GetType()}");
            }
        }
Esempio n. 2
0
        public override void Deserialise(ref object to, object[] values, ref int i)
        {
            object o;

            if (recurse)
            {
                o = Deserialiser <T> .Deserialise(values, ref i);
            }
            else if (values[i] is T)
            {
                o = values[i++];
            }
            else
            {
                throw new InvalidTypeException($"Expected type {typeof(T)} but instead got {values[i].GetType()}");
            }

            this.set(to, o);
        }