From cd467ed8a6afec8dcf50d8dc71c75d9d445f7489 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 5 Dec 2019 11:30:45 +0200 Subject: Working on PPC packages... --- .../PPCApplication/DefaultPPCApplicationManager.cs | 23 +++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs index ed5ea2629..95c4ccdac 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs @@ -32,6 +32,7 @@ using Tango.PPC.UI.Dialogs; using Tango.Core.Threading; using Tango.PPC.Common.Messages; using Tango.Core.ExtensionMethods; +using Tango.PPC.Common.Navigation; namespace Tango.PPC.UI.PPCApplication { @@ -130,6 +131,11 @@ namespace Tango.PPC.UI.PPCApplication /// public DateTime StartUpDate { get; private set; } + /// + /// Gets a value indicating whether an update has occurred before the application started. + /// + public bool IsAfterUpdate { get; private set; } + private bool _isScreenLocked; /// /// Gets or sets a value indicating whether the screen is currently locked. @@ -220,6 +226,10 @@ namespace Tango.PPC.UI.PPCApplication isAfterSetup = true; LogManager.Log("System restart is required."); } + else + { + IsAfterUpdate = true; + } settings.ApplicationState = ApplicationStates.Ready; settings.Save(); @@ -419,7 +429,7 @@ namespace Tango.PPC.UI.PPCApplication /// /// Restarts the application. /// - public void Restart() + public async void Restart() { if (IsShuttingDown) return; @@ -427,8 +437,19 @@ namespace Tango.PPC.UI.PPCApplication try { + _dispatcher.Invoke(() => + { + var nav = TangoIOC.Default.GetInstance(); + if (nav != null) + { + nav.NavigateTo(NavigationView.RestartingView); + } + }); + LogManager.Log("Restarting the application..."); + await Task.Delay(8000); + _watchdogServer.Dispose(); foreach (var vm in TangoIOC.Default.GetAllInstancesByBase()) -- cgit v1.3.1