private void NewNotification(Notification notification) { lock (_Database) { _Database.Notifications.Add(notification); _Database.Notifications.Sort(CompareNotifications); _Database.NotificationCount++; } SaveDatabase(); PlayNotificationSound(notification); _MainWindow.NewNotification(); }
private void PlayNotificationSound(Notification notification) { switch (notification.GetNotificationType()) { case NotificationType.Routine: PlayNotificationSound(); break; default: PlayErrorSound(); break; } }
private int CompareNotifications(Notification x, Notification y) { return - x.Time.CompareTo(y.Time); }