From 06ad24ef8a414fc89c0cf42b9f5264d584292afe Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 1 Feb 2018 11:39:19 +0200 Subject: Improved RequestShutDown Mechanism on machine studio UI implementation. Fixed issue with job brush markers visibility. Implemented Job Progress Indicator. --- .../DefaultStudioApplicationManager.cs | 29 ++++++++++++++-------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication') 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 a59ecf8e0..7ea18014c 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs @@ -118,6 +118,24 @@ namespace Tango.MachineStudio.UI.StudioApplication await Task.Factory.StartNew(async () => { + //Do Shutdown Procedures... + foreach (var vm in ServiceLocator.Current.GetAllInstancesByBase()) + { + try + { + var result = await vm.OnShutdownRequest(); + if (!result) + { + IsShuttingDown = false; + return; + } + } + catch (Exception ex) + { + LogManager.Log(ex, "Error on shutdown request with " + vm.GetType().Name); + } + } + try { if (ConnectedMachine != null) @@ -130,17 +148,6 @@ namespace Tango.MachineStudio.UI.StudioApplication LogManager.Log(ex, "Error disconnecting from machine."); } - //Do Shutdown Procedures... - foreach (var vm in ServiceLocator.Current.GetAllInstancesByBase()) - { - var result = await vm.OnShutdownRequest(); - if (!result) - { - IsShuttingDown = false; - return; - } - } - _navigationManager.NavigateTo(NavigationView.ShutdownView); Thread.Sleep(3000); Environment.Exit(0); -- cgit v1.3.1