public ActionResult Index(BaseModel.Message msg) { //var querys = HttpContext.Request var features = MvcApplication.engine.Features; var jmsg = features.ProcessRequest(msg); JsonNetResult jsonNetResult = new JsonNetResult(); jmsg.Data = jmsg.Data.Replace("\r\n", ""); //jsonNetResult.Formatting = Formatting.Indented; jsonNetResult.Data = jmsg; return(jsonNetResult); }
public override System.Threading.Tasks.Task OnConnected() { if (MvcApplication.engine.Features.CanLoadToUI()) { var msg = new BaseModel.Message(); msg.Category = "action"; msg.Data = "taxonomyloaded"; MvcApplication.engine.UIService.ToUI(msg); msg = new BaseModel.Message(); msg.Category = "action"; msg.Data = "instanceloaded"; MvcApplication.engine.UIService.ToUI(msg); //SendMessage(msg); } return(base.OnConnected()); }
public BaseModel.Message GetMessageFromRequest() { var msg = new BaseModel.Message(); var querys = HttpContext.Request.QueryString; msg.Category = querys["msg[Category]"]; msg.Url = querys["msg[Url]"]; msg.Id = querys["msg[Id]"]; msg.Data = querys["msg[Data]"]; msg.ContentType = querys["msg[ContentType]"]; var parameterkeys = querys.AllKeys.Where(i => i.Contains("msg[Parameters]")).ToList(); msg.Parameters = new Dictionary <string, string>(); foreach (var parameterkey in parameterkeys) { var key = Utilities.Strings.TextBetween(parameterkey, "msg[Parameters][", "]"); if (!String.IsNullOrEmpty(key)) { var value = querys[parameterkey]; msg.Parameters.Add(key, value); } } return(msg); }
public static void SendMessage(BaseModel.Message msg) { var hubContext = GlobalHost.ConnectionManager.GetHubContext <EngineHub>(); hubContext.Clients.All.sendMessage(msg); }