Beispiel #1
0
        public static void Deserialize(string _Input, out AdvertiseRequest Out)
        {
            StringReader _Reader = new StringReader (_Input);
            JSONReader JSONReader = new JSONReader (_Reader);

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

            switch (token) {

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

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

            // should we check for EOF here?
        }
Beispiel #2
0
        public static void Deserialize(string _Input, out QRequest Out)
        {
            StringReader _Reader = new StringReader (_Input);
            JSONReader JSONReader = new JSONReader (_Reader);

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

            switch (token) {

                case "QRequest" : {
                    Out = null;
                    throw new Exception ("Can't create abstract type");
                    }

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

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

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

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

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

            // should we check for EOF here?
        }