aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2023-10-18 11:30:52 +0300
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2023-10-18 11:45:04 +0300
commit81875b89c85e0785e4f575a6f24e05435cdec0af (patch)
tree915b12c4b861b51ba53478831ced0958a452bd41 /Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs
parent6633cb47da2bd14a5bbe356a7c4602c6d09462d1 (diff)
downloadTango-81875b89c85e0785e4f575a6f24e05435cdec0af.tar.gz
Tango-81875b89c85e0785e4f575a6f24e05435cdec0af.zip
Added update version/update db icons to x4
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.cs44
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)