Esempio n. 1
0
        public void PushFromServer(KeyValuePair <string, string> dictData)
        {
            IConnection connection = GlobalHost.ConnectionManager.GetConnectionContext <NotificationEngine>().Connection;

            Server.ProcessObject response = GetResponseObject(dictData);
            connection.Broadcast(response.Message);
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
 private Server.ProcessObject GetResponseObject(KeyValuePair <string, string> dictData)
 {
     Server.Request       objRequest = new Server.Request();
     Server.ProcessObject response   = objRequest.Initiate(dictData);
     return(response);
 }