diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2018-08-13 09:45:49 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2018-08-13 09:45:49 +0300 |
| commit | ab9db3ed6e2436969c2d0169236c72768d4feaf2 (patch) | |
| tree | 3f50a1d3906168c761bb2dfb889de7e62b9f0838 /Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs | |
| parent | 6707b4e66f619eb7906fe160bfe206c7266066ba (diff) | |
| parent | e8d4437f1f0f175213d65b9fda4baa63f118adb6 (diff) | |
| download | Tango-ab9db3ed6e2436969c2d0169236c72768d4feaf2.tar.gz Tango-ab9db3ed6e2436969c2d0169236c72768d4feaf2.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs | 33 |
1 files changed, 9 insertions, 24 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs index 7b4016341..2877d52b3 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs @@ -1,11 +1,13 @@ using System; using System.Collections.Generic; using System.Data.SqlClient; +using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; using Tango.Core; using Tango.Core.Commands; +using Tango.Core.Helpers; using Tango.PPC.Common; using Tango.PPC.Common.Application; using Tango.PPC.Common.MachineSetup; @@ -27,9 +29,7 @@ namespace Tango.PPC.UI.ViewModels Failed, } - private bool _postSetp; - - private SetupRequiredEventArgs _setupRequiredEventArgs; + private MachineSetupResult _setup_result; public IMachineSetupManager MachineSetupManager { get; set; } @@ -80,24 +80,9 @@ namespace Tango.PPC.UI.ViewModels applicationManager.SetupRequired += ApplicationManager_SetupRequired; } - private void ApplicationManager_SetupRequired(object sender, SetupRequiredEventArgs e) - { - _setupRequiredEventArgs = e; - } - - public override void OnApplicationStarted() - { - base.OnApplicationStarted(); - - if (_postSetp) - { - NavigationManager.NavigateTo(Common.Navigation.NavigationView.LoginView); - } - } - - public override void OnNavigatedTo() + private void ApplicationManager_SetupRequired(object sender, EventArgs e) { - base.OnNavigatedTo(); + NavigationManager.NavigateTo(NavigationView.MachineSetupView); } private void AppendLog(String msg) @@ -117,9 +102,8 @@ namespace Tango.PPC.UI.ViewModels try { - await MachineSetupManager.Setup(SerialNumber, HostAddress); - Settings.HasSetup = true; - _postSetp = true; + _setup_result = await MachineSetupManager.Setup(SerialNumber, HostAddress); + Settings.ApplicationState = ApplicationStates.SemiSetup; Settings.Save(); State = MachineSetupStates.Completed; } @@ -132,7 +116,8 @@ namespace Tango.PPC.UI.ViewModels private void CompleteSetup() { - NavigationManager.NavigateWithObject(NavigationView.LoadingView, new MachineSetupResult() { Completed = true }); + Process.Start(AssemblyHelper.GetCurrentAssemblyFolder() + "\\Tango.PPC.Updater.exe", _setup_result.UpdatePackagePath); + Environment.Exit(0); } } } |
