示例#1
0
        public virtual void DeserializeToken(JSONReader JSONReader, string Tag)
        {
            switch (Tag) {
                case "Identifier" : {
                    bool _Going = JSONReader.StartArray ();
                    Identifier = new List <Identifier> ();
                    while (_Going) {
                        Identifier _Item = new Identifier (JSONReader);
                        Identifier.Add (_Item);
                        _Going = JSONReader.NextArray ();
                        }

                    break;
                    }
                case "Connection" : {
                    Connection = new Connection (JSONReader);
                    break;
                    }
                default : {
                    break;
                    }
                }
            // check up that all the required elements are present
        }
示例#2
0
        public static void Deserialize(string _Input, out Connection Out)
        {
            StringReader _Reader = new StringReader (_Input);
            JSONReader JSONReader = new JSONReader (_Reader);

            JSONReader.StartObject ();
            string token = JSONReader.ReadToken ();
            Out = null;

            switch (token) {

                case "Connection" : {
                    Connection Result = new Connection ();
                    Result.Deserialize (JSONReader);
                    Out = Result;
                    break;
                    }

                default : {
                    throw new Exception ("Not supported");
                    }
                }
            JSONReader.EndObject ();

            // should we check for EOF here?
        }
示例#3
0
        public new void DeserializeToken(JSONReader JSONReader, string Tag)
        {
            switch (Tag) {
                case "Connection" : {
                    bool _Going = JSONReader.StartArray ();
                    Connection = new List <Connection> ();
                    while (_Going) {
                        Connection _Item = new Connection (JSONReader);
                        Connection.Add (_Item);
                        _Going = JSONReader.NextArray ();
                        }

                    break;
                    }
                case "Advice" : {
                    Advice = new Advice (JSONReader);
                    break;
                    }
                case "Policy" : {
                    bool _Going = JSONReader.StartArray ();
                    Policy = new List <String> ();
                    while (_Going) {
                        String _Item = JSONReader.ReadString ();
                        Policy.Add (_Item);
                        _Going = JSONReader.NextArray ();
                        }

                    break;
                    }
                default : {
                    ((QResponse)this).DeserializeToken(JSONReader, Tag);
                    break;
                    }
                }
            // check up that all the required elements are present
        }