From 1e24679bf65e42e5df96113bd1eef371036f0940 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Wed, 24 Oct 2018 16:18:39 +0300 Subject: Implemented job resume!! --- .../DefaultStudioApplicationManager.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs') diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs index 8be7f486a..3864708fc 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs @@ -25,6 +25,7 @@ using Tango.MachineStudio.UI.ViewModels; using Tango.MachineStudio.Common.Notifications; using Tango.MachineStudio.UI.Views; using Tango.Integration.Operation; +using Tango.MachineStudio.UI.Windows; namespace Tango.MachineStudio.UI.StudioApplication { @@ -39,6 +40,7 @@ namespace Tango.MachineStudio.UI.StudioApplication private IStudioModuleLoader _moduleLoader; private INotificationProvider _notification; private List _openedWindows; + private List _notified_view_models; /// /// Initializes a new instance of the class. @@ -50,6 +52,7 @@ namespace Tango.MachineStudio.UI.StudioApplication _navigationManager = navigationManager; _notification = notification; _openedWindows = new List(); + _notified_view_models = new List(); Application.Current.MainWindow.ContentRendered += (_, __) => { @@ -286,6 +289,11 @@ namespace Tango.MachineStudio.UI.StudioApplication window.Closed += (x, y) => { _openedWindows.Remove(window); }; } + public bool IsModuleInNewWindow(IStudioModule module) + { + return _openedWindows.Exists(x => (x as ModuleWindow).ModuleContext.Module == module); + } + /// /// Gets the core libraries version. /// @@ -324,7 +332,14 @@ namespace Tango.MachineStudio.UI.StudioApplication /// public void NotifyApplicationReady() { - TangoIOC.Default.GetAllInstancesByBase().ToList().ForEach(x => x.OnApplicationReady()); + TangoIOC.Default.GetAllInstancesByBase().ToList().ForEach(x => + { + if (!_notified_view_models.Contains(x)) + { + x.OnApplicationReady(); + _notified_view_models.Add(x); + } + }); } /// -- cgit v1.3.1