mirror of
https://github.com/openziti/desktop-edge-win.git
synced 2026-09-25 04:12:02 +00:00
51 lines
1.4 KiB
C#
51 lines
1.4 KiB
C#
using NLog;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows;
|
|
|
|
namespace Ziti.Desktop.Edge.Models
|
|
{
|
|
public class ZDEWViewState
|
|
{
|
|
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
|
|
|
private bool automaticUpdatesDisabled = false;
|
|
public bool AutomaticUpdatesDisabled
|
|
{
|
|
get
|
|
{
|
|
return automaticUpdatesDisabled;
|
|
}
|
|
set
|
|
{
|
|
automaticUpdatesDisabled = value;
|
|
}
|
|
}
|
|
|
|
public UpdateInfo PendingUpdate { get; set; } = new UpdateInfo();
|
|
|
|
internal void AutomaticUpdatesEnabledFromString(string automaticUpgradeDisabled)
|
|
{
|
|
bool disabled = bool.TrueString.ToLower() == automaticUpgradeDisabled?.ToLower().Trim();
|
|
this.AutomaticUpdatesDisabled = disabled;
|
|
}
|
|
}
|
|
public class UpdateInfo
|
|
{
|
|
public DateTime InstallTime { get; set; } = DateTime.MinValue;
|
|
public string Version { get; set; } = "0.0.0.0";
|
|
|
|
public double TimeLeft
|
|
{
|
|
get
|
|
{
|
|
double timeLeft = (InstallTime - DateTime.Now).TotalSeconds;
|
|
return timeLeft;
|
|
}
|
|
}
|
|
}
|
|
}
|