public virtual QResponse RequestResponse(QRequest RequestIn) { Request (RequestIn); return Response (); }
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); }
public abstract void Request(QRequest Request);
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? }