diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-08-13 16:12:45 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-08-13 16:12:45 +0300 |
| commit | 998cc8d4d91a7f85389cd0918f127257576c2c13 (patch) | |
| tree | 368ecd76f09b8ff1c4156a554b799cd231c42119 /Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs | |
| parent | 4490b0a76d4188cb285d62b106e208803ceaa133 (diff) | |
| download | Tango-998cc8d4d91a7f85389cd0918f127257576c2c13.tar.gz Tango-998cc8d4d91a7f85389cd0918f127257576c2c13.zip | |
Logs and comments for PPC.UI !
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs | 92 |
1 files changed, 66 insertions, 26 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs index 268f42ce9..3bcacc989 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs @@ -28,6 +28,8 @@ namespace Tango.PPC.UI.ViewModels [TangoInject] public IPPCModuleLoader ModuleLoader { get; set; } + #region Properties + private bool _isMenuOpened; /// <summary> /// Gets or sets a value indicating whether the side menu is opened. @@ -48,6 +50,10 @@ namespace Tango.PPC.UI.ViewModels set { _isNotificationsOpened = value; RaisePropertyChangedAuto(); } } + #endregion + + #region Commands + /// <summary> /// Gets or sets the module navigation command. /// </summary> @@ -78,6 +84,10 @@ namespace Tango.PPC.UI.ViewModels /// </summary> public RelayCommand SignOutCommand { get; set; } + #endregion + + #region Constructors + /// <summary> /// Initializes a new instance of the <see cref="LayoutViewVM"/> class. /// </summary> @@ -92,8 +102,17 @@ namespace Tango.PPC.UI.ViewModels SignOutCommand = new RelayCommand(SignOut); } + #endregion + + #region Private Methods + + /// <summary> + /// Stops the printing. + /// </summary> private void StopPrinting() { + LogManager.Log("Stop printing layout command pressed!"); + if (_jobHandler != null) { _jobHandler.Cancel(); @@ -107,10 +126,12 @@ namespace Tango.PPC.UI.ViewModels { if (NavigationManager.CanNavigateBack) { + LogManager.Log("Back command pressed."); NavigationManager.NavigateBack(); } else { + LogManager.Log("Menu command pressed."); IsMenuOpened = true; } } @@ -121,6 +142,7 @@ namespace Tango.PPC.UI.ViewModels /// <param name="moduleName">Name of the module.</param> private void NavigateToModule(string moduleName) { + LogManager.Log("Navigate to module command pressed."); IsMenuOpened = false; NavigationManager.NavigateTo(moduleName); } @@ -130,33 +152,48 @@ namespace Tango.PPC.UI.ViewModels /// </summary> private void NavigateHome() { + LogManager.Log("Navigate home command pressed."); IsMenuOpened = false; NavigationManager.NavigateTo(NavigationView.HomeModule); } /// <summary> - /// Called when the application has been started. + /// Represents an event that is raised when the sign-out operation is complete. /// </summary> - public override void OnApplicationStarted() + private void SignOut() { - base.OnApplicationStarted(); - ModuleLoader.ModulesLoaded += ModuleLoader_ModulesLoaded; - MachineProvider.MachineOperator.PrintingStarted += MachineOperator_PrintingStarted; + LogManager.Log("SignOut command pressed."); + AuthenticationProvider.LogOut(); + IsMenuOpened = false; } - private void MachineOperator_PrintingStarted(object sender, PrintingEventArgs e) + /// <summary> + /// Opens the first notification or display all. + /// </summary> + private void OpenFirstNotificationOrDisplayAll() { - _jobHandler = e.JobHandler; + if (NotificationProvider.NotificationItems.Count == 1) + { + //Open first + } + else + { + IsNotificationsOpened = true; + } } + #endregion + + #region Override Methods + /// <summary> - /// Handles the ModulesLoaded event of the ModuleLoader. + /// Called when the application has been started. /// </summary> - /// <param name="sender">The source of the event.</param> - /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> - private void ModuleLoader_ModulesLoaded(object sender, EventArgs e) + public override void OnApplicationStarted() { - View.ApplyModules(ModuleLoader.UserModules); + base.OnApplicationStarted(); + ModuleLoader.ModulesLoaded += ModuleLoader_ModulesLoaded; + MachineProvider.MachineOperator.PrintingStarted += MachineOperator_PrintingStarted; } /// <summary> @@ -167,28 +204,31 @@ namespace Tango.PPC.UI.ViewModels } + #endregion + + #region Event Handlers + /// <summary> - /// Represents an event that is raised when the sign-out operation is complete. + /// Handles the PrintingStarted event of the MachineOperator. /// </summary> - private void SignOut() + /// <param name="sender">The source of the event.</param> + /// <param name="e">The <see cref="PrintingEventArgs"/> instance containing the event data.</param> + private void MachineOperator_PrintingStarted(object sender, PrintingEventArgs e) { - AuthenticationProvider.LogOut(); - IsMenuOpened = false; + _jobHandler = e.JobHandler; } /// <summary> - /// Opens the first notification or display all. + /// Handles the ModulesLoaded event of the ModuleLoader. /// </summary> - private void OpenFirstNotificationOrDisplayAll() + /// <param name="sender">The source of the event.</param> + /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> + private void ModuleLoader_ModulesLoaded(object sender, EventArgs e) { - if (NotificationProvider.NotificationItems.Count == 1) - { - //Open first - } - else - { - IsNotificationsOpened = true; - } + LogManager.Log("Modules loaded. Applying modules to main navigation control..."); + View.ApplyModules(ModuleLoader.UserModules); } + + #endregion } } |
