aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2019-02-17 16:46:08 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2019-02-17 16:46:08 +0200
commit21cdc1e12814f72e6aac795f9ddd2a32b9614389 (patch)
tree6f5c988633df3c1bdc5fedc13e82023e4db5b7cf /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI
parent631e31df4c7d0474207e11b54885c1de6f9e80c7 (diff)
downloadTango-21cdc1e12814f72e6aac795f9ddd2a32b9614389.tar.gz
Tango-21cdc1e12814f72e6aac795f9ddd2a32b9614389.zip
Machine Studio 4.0.6.0
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs2
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs141
2 files changed, 75 insertions, 68 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs
index c9bba3ad8..951b80ab4 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs
@@ -4,5 +4,5 @@ using System.Runtime.InteropServices;
[assembly: System.Windows.ThemeInfo(System.Windows.ResourceDictionaryLocation.None, System.Windows.ResourceDictionaryLocation.SourceAssembly)]
[assembly: AssemblyTitle("Tango - Machine Studio")]
-[assembly: AssemblyVersion("4.0.5.0")]
+[assembly: AssemblyVersion("4.0.6.0")]
[assembly: ComVisible(false)] \ No newline at end of file
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 2e23d9d61..1be62565b 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs
@@ -182,100 +182,107 @@ namespace Tango.MachineStudio.UI.StudioApplication
await Task.Factory.StartNew(async () =>
{
- //Do Shutdown Procedures...
- foreach (var vm in TangoIOC.Default.GetAllInstancesByBase<IStudioViewModel>())
+ try
{
- try
+ //Do Shutdown Procedures...
+ foreach (var vm in TangoIOC.Default.GetAllInstancesByBase<IStudioViewModel>())
{
- var result = await vm.OnShutdownRequest();
- if (!result)
+ try
{
- IsShuttingDown = false;
- return;
+ var result = await vm.OnShutdownRequest();
+ if (!result)
+ {
+ IsShuttingDown = false;
+ return;
+ }
+ }
+ catch (Exception ex)
+ {
+ LogManager.Log(ex, "Error on shutdown request with " + vm.GetType().Name);
}
}
- catch (Exception ex)
+
+ foreach (var vm in TangoIOC.Default.GetAllInstancesByBase<IStudioViewModel>())
{
- LogManager.Log(ex, "Error on shutdown request with " + vm.GetType().Name);
+ vm.OnShuttingDown();
}
- }
-
- foreach (var vm in TangoIOC.Default.GetAllInstancesByBase<IStudioViewModel>())
- {
- vm.OnShuttingDown();
- }
- var settings = SettingsManager.Default.GetOrCreate<MachineStudioSettings>();
- settings.LastBounds = r;
- settings.StudioModulesBounds.Clear();
+ var settings = SettingsManager.Default.GetOrCreate<MachineStudioSettings>();
+ settings.LastBounds = r;
+ settings.StudioModulesBounds.Clear();
- foreach (var window in _openedWindows.OfType<Windows.ModuleWindow>())
- {
- window.Invoke(() =>
+ foreach (var window in _openedWindows.OfType<Windows.ModuleWindow>())
{
- var context = window.ModuleContext;
-
- if (context != null)
+ window.Invoke(() =>
{
- settings.StudioModulesBounds.Add(new MachineStudioSettings.StudioModuleBounds()
+ var context = window.ModuleContext;
+
+ if (context != null)
{
- Bounds = window.RestoreBounds,
- State = window.WindowState,
- Name = context.Module.Name,
- });
- }
- });
- }
+ settings.StudioModulesBounds.Add(new MachineStudioSettings.StudioModuleBounds()
+ {
+ Bounds = window.RestoreBounds,
+ State = window.WindowState,
+ Name = context.Module.Name,
+ });
+ }
+ });
+ }
- var mainViewVM = TangoIOC.Default.GetInstance<MainViewVM>();
+ var mainViewVM = TangoIOC.Default.GetInstance<MainViewVM>();
- settings.LastMainModuleName = mainViewVM.CurrentModule != null ? mainViewVM.CurrentModule.Name : null;
+ settings.LastMainModuleName = mainViewVM.CurrentModule != null ? mainViewVM.CurrentModule.Name : null;
- try
- {
- SettingsManager.Default.Save();
- }
- catch (Exception ex)
- {
- LogManager.Log(ex, "Error saving settings.");
- }
+ try
+ {
+ SettingsManager.Default.Save();
+ }
+ catch (Exception ex)
+ {
+ LogManager.Log(ex, "Error saving settings.");
+ }
- await _navigationManager.NavigateTo(NavigationView.ShutdownView);
+ await _navigationManager.NavigateTo(NavigationView.ShutdownView);
- Thread.Sleep(1500);
+ Thread.Sleep(1500);
- foreach (var window in _openedWindows)
- {
- ThreadsHelper.InvokeUI(() =>
+ foreach (var window in _openedWindows)
{
- window.Close();
- });
- }
+ ThreadsHelper.InvokeUI(() =>
+ {
+ window.Close();
+ });
+ }
- try
- {
- if (ConnectedMachine != null)
+ try
{
- ConnectedMachine.Disconnect().Wait();
+ if (ConnectedMachine != null)
+ {
+ ConnectedMachine.Disconnect().Wait();
+ }
+ }
+ catch (Exception ex)
+ {
+ LogManager.Log(ex, "Error disconnecting from machine.");
}
- }
- catch (Exception ex)
- {
- LogManager.Log(ex, "Error disconnecting from machine.");
- }
- var eventLogger = TangoIOC.Default.GetInstance<IEventLogger>();
- if (eventLogger != null)
- {
- eventLogger.Log(EventTypes.APPLICATION_TERMINATED, "Application Terminated!");
- eventLogger.FlushAll();
- }
+ var eventLogger = TangoIOC.Default.GetInstance<IEventLogger>();
+ if (eventLogger != null)
+ {
+ eventLogger.Log(EventTypes.APPLICATION_TERMINATED, "Application Terminated!");
+ eventLogger.FlushAll();
+ }
- Thread.Sleep(1500);
+ Thread.Sleep(1500);
- Environment.Exit(0);
+ Environment.Exit(0);
+ }
+ catch
+ {
+ Environment.Exit(0);
+ }
});
}