Esempio n. 1
0
        public override void Connect(string Name, string Service, int Port)
        {
            Identifier Identifier = new Identifier ();
            Identifier.Name = Name;
            Identifier.Service = Service;
            Identifier.Port = Port;

            QueryConnectRequest QueryConnectRequest = new QueryConnectRequest ();
            QueryConnectRequest.Identifier = Identifier;

            QResponse ResponseOut = WebBinding.RequestResponse (QueryConnectRequest);
        }
Esempio n. 2
0
        public new void DeserializeToken(JSONReader JSONReader, string Tag)
        {
            switch (Tag) {
                case "Identifier" : {
                    Identifier = new Identifier (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;
                    }
                case "ProveIt" : {
                    ProveIt = JSONReader.ReadBoolean ();
                    break;
                    }
                default : {
                    ((QRequest)this).DeserializeToken(JSONReader, Tag);
                    break;
                    }
                }
            // check up that all the required elements are present
        }
Esempio n. 3
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
        }
Esempio n. 4
0
        public static void Deserialize(string _Input, out Identifier Out)
        {
            StringReader _Reader = new StringReader (_Input);
            JSONReader JSONReader = new JSONReader (_Reader);

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

            switch (token) {

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

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

            // should we check for EOF here?
        }