Ejemplo n.º 1
0
 public virtual QResponse RequestResponse(QRequest RequestIn)
 {
     Request (RequestIn);
     return Response ();
 }
Ejemplo n.º 2
0
 public override void Request(QRequest Request)
 {
     BoundRequest BoundRequest = new BoundRequest (Request.ToString (), Cryptographic);
     Messages.Add (BoundRequest);
     Console.WriteLine (BoundRequest.HTTPBinding);
     PendingResponse =  QueryServer.Request (BoundRequest);
     Messages.Add (PendingResponse);
 }
Ejemplo n.º 3
0
 public abstract void Request(QRequest Request);
Ejemplo n.º 4
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?
        }