void Scheduler_PopupAlert(object sender, SchedulerNotifyPopupArgs e) { System.Diagnostics.Debug.WriteLine(string.Format("Scheduler_PopupAlert , {0}", e.AlertType)); if (e.AlertType == AlertsCategory.AlertAssignedTasks) { _viewmodel.Status.AddToLog("Initiating sequence for Assigned Task Alerts", false); Dispatcher.BeginInvoke(() => { try { string scriptFunction = (UserOptions.Current.IsAnimatedPopupAlertsEnabled == true) ? "PopupSequenceOnceOnlyWithAnimation" : "PopupSequenceOnceOnlyWithoutAnimation"; HtmlPage.Window.Invoke( scriptFunction, //"PopupSequenceOnceOnly", //Nov 10 new object[] { this.idIPC.ToString(), AlertsCategory.AlertAssignedTasks }); } catch (Exception ex) { ViewModel.Current.Status.StatusItems.Enqueue( new StatusItem { IsError = true, Message = ex.ToString() }); } }); } if (e.AlertType == AlertsCategory.AlertsManagedTasks) { _viewmodel.Status.AddToLog("Initiating sequence for Managed Task Alerts", false); Dispatcher.BeginInvoke(() => { try { string scriptFunction = (UserOptions.Current.IsAnimatedPopupAlertsEnabled == true) ? "PopupSequenceOnceOnlyWithAnimation" : "PopupSequenceOnceOnlyWithoutAnimation"; HtmlPage.Window.Invoke( scriptFunction, new object[] { idIPC.ToString(), AlertsCategory.AlertsManagedTasks }); } catch (Exception ex) { ViewModel.Current.Status.StatusItems.Enqueue( new StatusItem { IsError = true, Message = ex.ToString() }); } } ); } }
void notifyManagedTasksTimer_Tick(object state) { System.Diagnostics.Debug.WriteLine("notifyManagedTasksTimer_Tick:" + DateTime.Now.ToLongTimeString()); if (PopupAlert == null) return; if (!IsManagedTasksPopupEnabled) { Parent.Status.AddToLog("Not displaying manager alerts because it was found to be disabled", false); return; } if (!Parent.TaskAlerts.ManagedTasksAlerts.Any()) { Parent.Status.AddToLog("Not displaying manager alerts because zero alerts were found", false); return; } Deployment.Current.Dispatcher.BeginInvoke(delegate() { var arg = new SchedulerNotifyPopupArgs {AlertType = AlertsCategory.AlertsManagedTasks}; PopupAlert(this, arg); }); }