private void CreateRow(Task task, bool showNotif = false) { if (!TaskGridContains(task)) { var taskHistory = DatabaseAccess.Get(task.Id); RowControl rowControl = null; if (taskHistory != null) { taskHistory.ExpectedTime = task.ExpectedTime; // override to make sure there is no bug rowControl = new RowControl(taskHistory); } else { rowControl = new RowControl(task); } rowControl.AddListener(this); TasksGrid.Children.Add(rowControl); Grid.SetColumn(rowControl, 0); Grid.SetRow(rowControl, row_number); AddRowTasksGrid(); row_number++; if (showNotif) { BaloonNotification.ShowNotificationIcon($"You Received a new Task: '{task.Summary}'"); } } }
private void TimerTick(object sender, EventArgs e) { var time = taskControl.historyControl.CalculateTotalTime(); lblTime.Content = taskControl.historyControl.RenderTime(time); if (time.TotalHours > ExpectedTime && ExpectedTime > 0 && !m_HasNotifyExpectedTime) { var notif = BaloonNotification.ShowNotificationIcon($"The timer '{Id}' has exceeded the expected time of {ExpectedTime} hours."); notif.Click += OnNotificationClicked; m_HasNotifyExpectedTime = true; } }
void OnSessionSwitch(object sender, SessionSwitchEventArgs e) { switch (e.Reason) { case SessionSwitchReason.SessionLogon: case SessionSwitchReason.SessionUnlock: BaloonNotification.ShowNotificationIcon("All Timer are stopped"); break; case SessionSwitchReason.SessionLock: case SessionSwitchReason.SessionLogoff: break; } }