public override void Add(WitResponseNode aItem) { var tmp = new WitResponseArray(); tmp.Add(aItem); Set(tmp); }
public override WitResponseNode this[int aIndex] { get { return(new WitResponseLazyCreator(this)); } set { var tmp = new WitResponseArray(); tmp.Add(value); Set(tmp); } }
public static WitResponseNode Deserialize(System.IO.BinaryReader aReader) { JSONBinaryTag type = (JSONBinaryTag)aReader.ReadByte(); switch (type) { case JSONBinaryTag.Array: { int count = aReader.ReadInt32(); WitResponseArray tmp = new WitResponseArray(); for (int i = 0; i < count; i++) { tmp.Add(Deserialize(aReader)); } return(tmp); } case JSONBinaryTag.Class: { int count = aReader.ReadInt32(); WitResponseClass tmp = new WitResponseClass(); for (int i = 0; i < count; i++) { string key = aReader.ReadString(); var val = Deserialize(aReader); tmp.Add(key, val); } return(tmp); } case JSONBinaryTag.Value: { return(new WitResponseData(aReader.ReadString())); } case JSONBinaryTag.IntValue: { return(new WitResponseData(aReader.ReadInt32())); } case JSONBinaryTag.DoubleValue: { return(new WitResponseData(aReader.ReadDouble())); } case JSONBinaryTag.BoolValue: { return(new WitResponseData(aReader.ReadBoolean())); } case JSONBinaryTag.FloatValue: { return(new WitResponseData(aReader.ReadSingle())); } default: { throw new JSONParseException("Error deserializing JSON. Unknown tag: " + type); } } }