diff options
| author | Avi Levkovich <avi@twine-s.com> | 2018-07-09 13:32:33 +0300 |
|---|---|---|
| committer | Avi Levkovich <avi@twine-s.com> | 2018-07-09 13:32:33 +0300 |
| commit | 6b755271ed4ef5f1b1d09d96e54fe081920f4f41 (patch) | |
| tree | 51f6bb96aefb3666c827d1dd06ef6d76cf81a44a /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs | |
| parent | 042a453f826da5c8a600ab4ae8b3d611044168de (diff) | |
| parent | 47396728e782e433a11768904cda94c47dc02933 (diff) | |
| download | Tango-6b755271ed4ef5f1b1d09d96e54fe081920f4f41.tar.gz Tango-6b755271ed4ef5f1b1d09d96e54fe081920f4f41.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs index aa0eedefb..8eaa1f360 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs @@ -159,6 +159,11 @@ namespace Tango.MachineStudio.UI.ViewModels /// </summary> public RelayCommand OpenDeveloperConsoleCommand { get; set; } + /// <summary> + /// Gets or sets the about command. + /// </summary> + public RelayCommand AboutCommand { get; set; } + private IAuthenticationProvider _authenticationProvider; /// <summary> /// Gets or sets the authentication provider. @@ -319,6 +324,8 @@ namespace Tango.MachineStudio.UI.ViewModels OpenDeveloperConsoleCommand = new RelayCommand(OpenDeveloperConsole); TangoMessenger.Default.Register<Messages.ForcedUpdateMessage>((x) => DisableCheckForUpdates = true); + + AboutCommand = new RelayCommand(ShowAboutDialog); } private void MachineEventsStateProvider_EventsResolved(object sender, IEnumerable<MachinesEvent> e) @@ -502,9 +509,32 @@ namespace Tango.MachineStudio.UI.ViewModels } else { - _notificationProvider.ShowModalDialog<ConnectedMachineViewVM>((x) => + _notificationProvider.ShowModalDialog<ConnectedMachineViewVM>(async (x) => { - DisconnectFromMachine(); + if (x.Result == ConnectedMachineViewVM.ConnectedMachineVMResult.Disconnect) + { + DisconnectFromMachine(); + } + else if (x.Result == ConnectedMachineViewVM.ConnectedMachineVMResult.UploadHardwareConfig) + { + if (NotificationProvider.ShowQuestion("This will reset the machine hardware configuration to the database configuration. Are you sure?")) + { + using (NotificationProvider.PushTaskItem("Uploading hardware configuration...")) + { + try + { + var configuration = ApplicationManager.ConnectedMachine.Machine.Configuration; + await ApplicationManager.ConnectedMachine.UploadHardwareConfiguration(configuration.HardwareVersion, configuration); + NotificationProvider.ShowInfo("Hardware configuration uploaded successfully."); + } + catch (Exception ex) + { + LogManager.Log(ex, "Error upload hardware configuration."); + NotificationProvider.ShowError("Error upload hardware configuration." + Environment.NewLine + ex.Message); + } + } + } + } }); } @@ -660,6 +690,14 @@ namespace Tango.MachineStudio.UI.ViewModels } } + /// <summary> + /// Shows the about dialog. + /// </summary> + private void ShowAboutDialog() + { + NotificationProvider.ShowModalDialog<AboutViewVM>((x) => { }); + } + private void ReportIssue() { _notificationProvider.ShowModalDialog<ReportIssueViewVM, ReportIssueView>(new ReportIssueViewVM(TFSClient.Project, TFSClient.CreateBug()), async (vm) => |
