diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2018-12-16 08:22:45 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2018-12-16 08:22:45 +0200 |
| commit | ecf55f4193c0a7ab273c7e8243e446a2f2c32d51 (patch) | |
| tree | aa965e23ba3d0dcd4fecf739b4ed95040553b628 /Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs | |
| parent | b279560f0b4dfdd16dea6b70975dfc1961b8d61e (diff) | |
| download | Tango-ecf55f4193c0a7ab273c7e8243e446a2f2c32d51.tar.gz Tango-ecf55f4193c0a7ab273c7e8243e446a2f2c32d51.zip | |
Working on PPC tech mode & logging module.
Working on PPC date picker & calendar.
Implemented no-permissions view.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs index 219c25f45..302e401fb 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs @@ -15,6 +15,8 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using Tango.Core.DI; +using Tango.PPC.Common.Application; using Tango.Touch.Helpers; namespace Tango.PPC.UI @@ -24,6 +26,8 @@ namespace Tango.PPC.UI /// </summary> public partial class MainWindow : Window { + private String _technician_mode_buffer; + public static MainWindow Instance { get; private set; } public MainWindow() @@ -32,6 +36,8 @@ namespace Tango.PPC.UI InitializeComponent(); + _technician_mode_buffer = String.Empty; + #if !DESKTOP if (TouchHelper.IsTouchEnabled()) { @@ -62,5 +68,34 @@ namespace Tango.PPC.UI { Environment.Exit(0); } + + protected override void OnPreviewKeyDown(System.Windows.Input.KeyEventArgs e) + { + base.OnPreviewKeyDown(e); + + try + { + _technician_mode_buffer += Char.Parse(e.Key.ToString()); + } + catch{} + + if (e.Key == Key.Return || e.Key == Key.Tab) + { + if (_technician_mode_buffer.ToLower().Contains("ENTERTECHNICIAN".ToLower())) + { + _technician_mode_buffer = String.Empty; + TangoIOC.Default.GetInstance<IPPCApplicationManager>().EnterTechnicianMode(); + e.Handled = true; + } + else if (_technician_mode_buffer.ToLower().Contains("EXITTECHNICIAN".ToLower())) + { + _technician_mode_buffer = String.Empty; + TangoIOC.Default.GetInstance<IPPCApplicationManager>().ExitTechnicianMode(); + e.Handled = true; + } + + _technician_mode_buffer = String.Empty; + } + } } } |
