aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs15
1 files changed, 9 insertions, 6 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
index 739f0bcde..106848b7a 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
@@ -63,6 +63,7 @@ namespace Tango.MachineStudio.Developer.ViewModels
private ISpeechProvider _speech;
private DataCapture.ViewModels.MainViewVM _dataCaptureVM;
private bool _isRecording;
+ private DeveloperModuleSettings _settings;
#region Properties
@@ -620,6 +621,8 @@ namespace Tango.MachineStudio.Developer.ViewModels
/// <param name="notificationProvider">The notification provider.</param>
public MainViewVM(IStudioApplicationManager applicationManager, INotificationProvider notificationProvider, IDiagnosticsFrameProvider diagnosticsFrameProvider, IVideoCaptureProvider videoCaptureProvider, DeveloperNavigationManager navigation, IAuthenticationProvider authentication, IEventLogger eventLogger, ISpeechProvider speech)
{
+ _settings = SettingsManager.Default.GetOrCreate<DeveloperModuleSettings>();
+
SelectedJobs = new ObservableCollection<Job>();
JobEvents = new ObservableCollection<MachinesEvent>();
@@ -629,16 +632,16 @@ namespace Tango.MachineStudio.Developer.ViewModels
Machines = _machineDbContext.Machines.ToObservableCollection();
- if (SettingsManager.Default.MachineStudio.DeveloperModule.LastSelectedMachineGuid != null)
+ if (_settings.LastSelectedMachineGuid != null)
{
LogManager.Log("Setting last selected machine from settings...");
- SelectedMachine = _machineDbContext.Machines.SingleOrDefault(x => x.Guid == SettingsManager.Default.MachineStudio.DeveloperModule.LastSelectedMachineGuid);
+ SelectedMachine = _machineDbContext.Machines.SingleOrDefault(x => x.Guid == _settings.LastSelectedMachineGuid);
}
- if (SettingsManager.Default.MachineStudio.DeveloperModule.LastSelectedJobGuid != null && SelectedMachine != null)
+ if (_settings.LastSelectedJobGuid != null && SelectedMachine != null)
{
LogManager.Log("Setting last selected job from settings...");
- SelectedMachineJob = SelectedMachine.Jobs.SingleOrDefault(x => x.Guid == SettingsManager.Default.MachineStudio.DeveloperModule.LastSelectedJobGuid);
+ SelectedMachineJob = SelectedMachine.Jobs.SingleOrDefault(x => x.Guid == _settings.LastSelectedJobGuid);
}
_authentication = authentication;
@@ -1907,8 +1910,8 @@ namespace Tango.MachineStudio.Developer.ViewModels
public override void OnShuttingDown()
{
- SettingsManager.Default.MachineStudio.DeveloperModule.LastSelectedMachineGuid = SelectedMachine != null ? SelectedMachine.Guid : null;
- SettingsManager.Default.MachineStudio.DeveloperModule.LastSelectedJobGuid = SelectedMachineJob != null ? SelectedMachineJob.Guid : null;
+ _settings.LastSelectedMachineGuid = SelectedMachine != null ? SelectedMachine.Guid : null;
+ _settings.LastSelectedJobGuid = SelectedMachineJob != null ? SelectedMachineJob.Guid : null;
}
#endregion