diff options
| author | Roy <Roy.mail.net@gmail.com> | 2023-10-22 16:40:33 +0300 |
|---|---|---|
| committer | Roy <Roy.mail.net@gmail.com> | 2023-10-22 16:40:33 +0300 |
| commit | f35fea4ffd1219e844f94a0b72c12cc91af2c94e (patch) | |
| tree | 12a9256ee4f87fabe398f0ba59f06df3e40c248d /Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician | |
| parent | e0edf9de24600db0242952064475fbbde157ccaf (diff) | |
| download | Tango-f35fea4ffd1219e844f94a0b72c12cc91af2c94e.tar.gz Tango-f35fea4ffd1219e844f94a0b72c12cc91af2c94e.zip | |
factory reset for eureka
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician')
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs index e3f695514..143cfe875 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs @@ -16,6 +16,7 @@ using Tango.Settings; using System.Data.Entity; using Tango.PPC.Common.UWF; using Tango.BL.Entities; +using Tango.PPC.Common.Build; namespace Tango.PPC.Technician.ViewModels { @@ -134,25 +135,33 @@ namespace Tango.PPC.Technician.ViewModels { Settings.ApplicationState = ApplicationStates.FactoryRestore; Settings.Save(); - try - { - NotificationProvider.SetGlobalBusyMessage("Disabling write filter protection..."); - await _uwf.Disable(); - await Task.Delay(2000); - NotificationProvider.ReleaseGlobalBusyMessage(); - await NavigationManager.NavigateTo(Common.Navigation.NavigationView.RestartingSystemView); - await Task.Delay(4000); - _os.Restart(); - } - catch (Exception ex) + + if (BuildProvider.BuildType == BuildType.TS1800) { - LogManager.Log(ex, "Error executing factory reset."); - NotificationProvider.ReleaseGlobalBusyMessage(); - await NotificationProvider.ShowError($"Error executing factory reset.\n{ex.FlattenMessage()}"); + try + { + NotificationProvider.SetGlobalBusyMessage("Disabling write filter protection..."); + await _uwf.Disable(); + await Task.Delay(2000); + NotificationProvider.ReleaseGlobalBusyMessage(); + await NavigationManager.NavigateTo(Common.Navigation.NavigationView.RestartingSystemView); + await Task.Delay(4000); + _os.Restart(); + } + catch (Exception ex) + { + LogManager.Log(ex, "Error executing factory reset."); + NotificationProvider.ReleaseGlobalBusyMessage(); + await NotificationProvider.ShowError($"Error executing factory reset.\n{ex.FlattenMessage()}"); + } + finally + { + NotificationProvider.ReleaseGlobalBusyMessage(); + } } - finally + else { - NotificationProvider.ReleaseGlobalBusyMessage(); + ApplicationManager.Restart(); } } } |
