diff options
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 | 44 |
1 files changed, 44 insertions, 0 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 17b676499..56314414a 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs @@ -14,8 +14,10 @@ using Tango.Integration.Operation; using Tango.PMR.IFS; using Tango.PPC.Common; using Tango.PPC.Common.Connection; +using Tango.PPC.Common.MachineUpdate; using Tango.PPC.Common.Modules; using Tango.PPC.Common.Navigation; +using Tango.PPC.Common.Web; using Tango.PPC.UI.Dialogs; using Tango.PPC.UI.Views; using Tango.PPC.UI.ViewsContracts; @@ -39,6 +41,9 @@ namespace Tango.PPC.UI.ViewModels [TangoInject] public IPPCModuleLoader ModuleLoader { get; set; } + [TangoInject] + public IMachineUpdateManager MachineUpdateManager { get; set; } + #region Classes public class CartridgeModel : ExtendedObject @@ -230,6 +235,26 @@ namespace Tango.PPC.UI.ViewModels set { _currentDateTime = value; RaisePropertyChangedAuto(); } } + private bool _enableDBUpdate; + /// <summary> + /// Gets or sets a value indicating whether to automatically check for new application updates. + /// </summary> + public bool EnableDBUpdate + { + get { return _enableDBUpdate; } + set { _enableDBUpdate = value; RaisePropertyChangedAuto(); } + } + + private bool _enableVersionUpdate; + /// <summary> + /// Gets or sets a value indicating whether to automatically check for new application updates. + /// </summary> + public bool EnableVersionUpdate + { + get { return _enableVersionUpdate; } + set { _enableVersionUpdate = value; RaisePropertyChangedAuto(); } + } + #endregion #region Commands @@ -327,6 +352,8 @@ namespace Tango.PPC.UI.ViewModels _date_timer.Interval = TimeSpan.FromSeconds(1); _date_timer.Tick += _date_timer_Tick; _date_timer.Start(); + + _enableDBUpdate = _enableVersionUpdate = false; } #endregion @@ -564,6 +591,22 @@ namespace Tango.PPC.UI.ViewModels MachineProvider.MachineOperator.InkFillingStatusChanged += MachineOperator_InkFillingStatusChanged; } + private void MachineUpdateManager_UpdateAvailable(object sender, CheckForUpdateResponse e) + { + EnableVersionUpdate = false; + EnableDBUpdate = false; + + if(e.IsUpdateAvailable) + { + EnableVersionUpdate = true; + return; + } + else if (e.IsDatabaseUpdateAvailable) + { + EnableDBUpdate = true; + } + } + private void MachineOperator_InkFillingStatusChanged(object sender, InkFillingStatusChangedEventArgs e) { if (Cartridges == null) @@ -618,6 +661,7 @@ namespace Tango.PPC.UI.ViewModels { base.OnApplicationReady(); MachineProvider.MachineOperator.StatusChanged += MachineOperator_StatusChanged; + MachineUpdateManager.UpdateAvailable += MachineUpdateManager_UpdateAvailable; } private void MachineOperator_StatusChanged(object sender, MachineStatuses e) |
