public static void Deserialize(string _Input, out Request Out) { StringReader _Reader = new StringReader (_Input); JSONReader JSONReader = new JSONReader (_Reader); JSONReader.StartObject (); string token = JSONReader.ReadToken (); Out = null; switch (token) { case "Request" : { Out = null; throw new Exception ("Can't create abstract type"); } case "BindRequest" : { Out = null; throw new Exception ("Can't create abstract type"); } case "OpenRequest" : { OpenRequest Result = new OpenRequest (); Result.Deserialize (JSONReader); Out = Result; break; } case "TicketRequest" : { TicketRequest Result = new TicketRequest (); Result.Deserialize (JSONReader); Out = Result; break; } case "UnbindRequest" : { UnbindRequest Result = new UnbindRequest (); Result.Deserialize (JSONReader); Out = Result; break; } default : { throw new Exception ("Not supported"); } } JSONReader.EndObject (); // should we check for EOF here? }
public virtual Response RequestResponse(Request RequestIn) { Request (RequestIn); return Response (); }
public override void Request(Request Request) { }
public abstract void Request(Request Request);
public override void Request(Request Request) { BoundRequest BoundRequest = new BoundRequest (Request.ToString (), Cryptographic); Messages.Add (BoundRequest); Console.WriteLine (BoundRequest.HTTPBinding); PendingResponse = ConnectionServer.Request (BoundRequest); Messages.Add (PendingResponse); }