From 402099d85ff0582bb48484d47fb2c4b6deb2e020 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Wed, 20 May 2020 06:27:49 +0300 Subject: Prevent multiple job synchronization notifications. --- .../PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs index af576ac93..f9029ed8c 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs @@ -51,6 +51,7 @@ namespace Tango.PPC.Jobs.ViewModels private ObservableCollection _catalogs; //Holds the available color catalogs for the site. private ObservableCollection _rmls; //Holds the available RML for the site. private List _colorSpaces; //Holds the available color spaces. + private bool _isJobsSynchronizationNotificationActive; public enum JobsCategory { @@ -893,16 +894,23 @@ namespace Tango.PPC.Jobs.ViewModels private void MachineDataSynchronizer_SynchronizationEnded(object sender, SynchronizationEndedEventArgs e) { - if (e.NewChangedJobs > 0) + if (e.NewChangedJobs > 0 && !_isJobsSynchronizationNotificationActive) { + _isJobsSynchronizationNotificationActive = true; + var item = NotificationProvider.PushNotification(); item.Pressed += (_, __) => { + _isJobsSynchronizationNotificationActive = false; LoadJobs(() => { NotificationProvider.ShowSuccess("Your job list is now synchronized."); }); }; + item.Closed += (_, __) => + { + _isJobsSynchronizationNotificationActive = false; + }; } } -- cgit v1.3.1