aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2019-03-21 16:43:18 +0200
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2019-03-21 16:43:18 +0200
commitc73929a0e75705cdb8adbbdb45ea017e3bb09374 (patch)
tree9df7c0a3880a031e44c7896fd588b370367f9035 /Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs
parent977d88f94cfb192d09f0253aaf3442f2c17e60f2 (diff)
parent5881b11e25a34acc0230f5316db5783389afe18f (diff)
downloadTango-c73929a0e75705cdb8adbbdb45ea017e3bb09374.tar.gz
Tango-c73929a0e75705cdb8adbbdb45ea017e3bb09374.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs27
1 files changed, 24 insertions, 3 deletions
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 788d2b178..261dbe6d4 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs
@@ -28,6 +28,7 @@ using Tango.PPC.Common.EventLogging;
using Tango.BL.Enumerations;
using Tango.PPC.Common.Notifications;
using Tango.PPC.Common.WatchDog;
+using Tango.PPC.UI.Dialogs;
namespace Tango.PPC.UI.PPCApplication
{
@@ -89,6 +90,11 @@ namespace Tango.PPC.UI.PPCApplication
public bool IsShuttingDown { get; private set; }
/// <summary>
+ /// Gets a value indicating whether the application is in technician mode.
+ /// </summary>
+ public bool IsInTechnicianMode { get; private set; }
+
+ /// <summary>
/// Gets the application version.
/// </summary>
public Version Version
@@ -412,10 +418,24 @@ namespace Tango.PPC.UI.PPCApplication
/// <summary>
/// Enteres the application technician mode.
/// </summary>
- public void EnterTechnicianMode()
+ public async void EnterTechnicianMode()
{
- _moduleLoader.AllModules.ToList().ForEach(x => x.OnTechnicianEntered());
- _notificationProvider.ShowInfo("Technician mode is now enabled.");
+ var vm = await _notificationProvider.ShowDialog<TechnicianModeLoginViewVM>();
+
+ if (vm.DialogResult)
+ {
+ if (vm.Password == "Aa123456")
+ {
+ IsInTechnicianMode = true;
+ _moduleLoader.AllModules.ToList().ForEach(x => x.OnTechnicianEntered());
+ await _notificationProvider.ShowInfo("Technician mode is now enabled.");
+ }
+ else
+ {
+ await _notificationProvider.ShowError("Invalid technician mode password.");
+ EnterTechnicianMode();
+ }
+ }
}
/// <summary>
@@ -423,6 +443,7 @@ namespace Tango.PPC.UI.PPCApplication
/// </summary>
public void ExitTechnicianMode()
{
+ IsInTechnicianMode = false;
_moduleLoader.AllModules.ToList().ForEach(x => x.OnTechnicianExited());
_notificationProvider.ShowInfo("Technician mode is now disabled.");
}