aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs29
1 files changed, 18 insertions, 11 deletions
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<IShutdownRequestBlocker>())
+ {
+ 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<IShutdownRequestBlocker>())
- {
- var result = await vm.OnShutdownRequest();
- if (!result)
- {
- IsShuttingDown = false;
- return;
- }
- }
-
_navigationManager.NavigateTo(NavigationView.ShutdownView);
Thread.Sleep(3000);
Environment.Exit(0);