Ejemplo n.º 1
0
        public static void Deserialize(string _Input, out Advice Out)
        {
            StringReader _Reader = new StringReader (_Input);
            JSONReader JSONReader = new JSONReader (_Reader);

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

            switch (token) {

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

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

            // should we check for EOF here?
        }
Ejemplo n.º 2
0
 public virtual void DeserializeToken(JSONReader JSONReader, string Tag)
 {
     switch (Tag) {
         case "IPAddress" : {
             IPAddress = JSONReader.ReadString ();
             break;
             }
         case "IPPort" : {
             IPPort = JSONReader.ReadInteger32 ();
             break;
             }
         case "Transport" : {
             Transport = JSONReader.ReadString ();
             break;
             }
         case "TransportPolicy" : {
             TransportPolicy = JSONReader.ReadString ();
             break;
             }
         case "ProtocolPolicy" : {
             ProtocolPolicy = JSONReader.ReadString ();
             break;
             }
         case "Advice" : {
             Advice = new Advice (JSONReader);
             break;
             }
         default : {
             break;
             }
         }
     // check up that all the required elements are present
 }
Ejemplo n.º 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
        }