public void PushFromServer(KeyValuePair <string, string> dictData) { IConnection connection = GlobalHost.ConnectionManager.GetConnectionContext <NotificationEngine>().Connection; Server.ProcessObject response = GetResponseObject(dictData); connection.Broadcast(response.Message); }
protected override Task OnReceived(IRequest request, string connectionId, string data) { KeyValuePair <string, string> dictData = JsonConvert.DeserializeObject <KeyValuePair <string, string> >(data); Server.ProcessObject response = GetResponseObject(dictData); return(Connection.Broadcast(response.Message)); }
public ProcessObject CreateObject(string key, string value) { ProcessObject responseObject = null; switch (key) { case "init": responseObject = new Response.ProcessInit(); responseObject.Process(value); break; case "order": responseObject = new Response.ProcessOrder(); responseObject.Process(value); break; case "seats": responseObject = new Response.ProcessSeats(); responseObject.Process(value); break; } return(responseObject); }
private Server.ProcessObject GetResponseObject(KeyValuePair <string, string> dictData) { Server.Request objRequest = new Server.Request(); Server.ProcessObject response = objRequest.Initiate(dictData); return(response); }