public JsonResult GetAlarms() { var alarms = AlarmsViewModel.OnGKObjectsStateChanged(null); var alarmsViewModel = new AlarmsViewModel(); alarmsViewModel.UpdateAlarms(alarms); return Json(alarmsViewModel, JsonRequestBehavior.AllowGet); }
public void BroadcastAlarms() { var alarms = AlarmsViewModel.OnGKObjectsStateChanged(null); var alarmsViewModel = new AlarmsViewModel(); alarmsViewModel.UpdateAlarms(alarms); var alarmGroupsViewModel = new AlarmGroupsViewModel(); alarmGroupsViewModel.Update(alarms); Clients.All.updateAlarms(new {alarms = alarmsViewModel, groups = alarmGroupsViewModel}); }