private void pausedSessionNotifier() { mynotif = new Notification(); mynotif.Title = "Session Paused"; //--TODO -----to be filled dynamicly later mynotif.Description = "Finished work already ? "; mynotif.Timestamp = DateTime.Now; mynotif.Type = notificationType[3]; // sending notification sendNotification(mynotif); }
private void startSessionTimeNotify() { mynotif = new Notification(); mynotif.Title = "Session started"; //--TODO -----to be filled dynamicly later mynotif.Description = "Work hard but not too hard! "; mynotif.Timestamp = DateTime.Now; mynotif.Type = notificationType[0]; // sending notification sendNotification(mynotif); }
private void notifyToRelax(int seconds2Relax) // add relax notification with each nbr of seconds { if ((timesTicked % seconds2Relax) == 0) { String adviceToSend = NotificationSelector(); ; //send notification every seconds2Relax seconds( default 1200s - 20mins ) Notification n = new Notification( notificationType[2], "Advice", adviceToSend); n.Timestamp = DateTime.Now; sendNotification(n); } }
private void endSessionTimeNotify() //add end of session notif to listview of notifs { mynotif = new Notification(); mynotif.Title = "Session over"; //--TODO -----to be filled dynamicly later mynotif.Description = "You have completed your work session , good job ! "; mynotif.Timestamp = DateTime.Now; mynotif.Type = notificationType[1]; // sending notification sendNotification(mynotif); }
// ----------------------Notification methods -------------------- private void sendNotification(Notification notif) // adds a notification to Listview { SharedInfo.myNotifications.Insert(0, notif); try { SharedInfo.myNotifications.RemoveAt(6); } catch (Exception) { } mylist.ItemsSource = null; mylist.ItemsSource = SharedInfo.myNotifications; //---------------------TOAST------------------------------------- if (notif.Type.Equals("START")) { sendToast(0,1, "Work Session Started", ""+DateTime.Now.ToString("ddddd HH:mm")); sendToast((Paramaters.PrefSnoozeMinutes + Paramaters.PrefSnoozeHours * 60),1, "Break Time", NotificationSelector()); } if (notif.Type.Equals("END")) { sendToast(0,2, "Work Session Ended", ""+DateTime.Now.ToString("dddddd HH:mm")); } if (notif.Type.Equals("Advice")) { if ( hours*60+minutes > (Paramaters.PrefSnoozeHours*60+Paramaters.PrefSnoozeMinutes)) sendToast(Paramaters.PrefSnoozeMinutes + Paramaters.PrefSnoozeHours * 60,1, "Break Time Reminder", NotificationSelector()); } if (notif.Type.Equals("PAUSE")) { sendToast(0,2, "Work Session Paused",""+DateTime.Now.ToString("dddddd HH:mm")); } }