private void BackgroundWorker_EventHandler(object sender, NotificationsEventArgs args) { for (int i = 0; i < args.Notifications.Count; i++) { if (!args.Notifications[i].EstLu) { bool bEstPresente = false; for (int j = 0; j < NotificationsDerniereActualisation.Count; j++) { if (args.Notifications[i].Message == NotificationsDerniereActualisation[j].Message && args.Notifications[i].TempsReception == NotificationsDerniereActualisation[j].TempsReception) { bEstPresente = true; } } if (!bEstPresente) { SnackbarMessageQueue.Enqueue(args.Notifications[i].Message, "Voir", notification => { notification.EstLu = true; DataModelNotification.Set("estLu", notification, "true"); notification.Voir(ViewModel.ViewModelSuperEcran.GestionnaireSousEcrans); }, args.Notifications[i] ); } } } NotificationsDerniereActualisation = args.Notifications; ANotifier?.Invoke(this, args); }
public void PostNotification(string message, LienNotificationEcran lien, Employe employe) => DataModelNotification.PostNotification(message, lien, employe);
private void ObtenirNotifications() => EventHandler?.Invoke(this, new NotificationsEventArgs(DataModelNotification.GetNotifications(UsagerConnecte.Usager)));