Updates to logging and v1.0.3 release.
This commit is contained in:
@@ -135,6 +135,26 @@ namespace BodyshopPartner.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private ICommand _installUpdatesCommand;
|
||||
public ICommand InstallUpdatesCommand
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_installUpdatesCommand == null)
|
||||
{
|
||||
_installUpdatesCommand = new RelayCommand(
|
||||
p => UpdateAvailable,
|
||||
async p =>
|
||||
{
|
||||
await InstallUpdates();
|
||||
});
|
||||
}
|
||||
return _installUpdatesCommand;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private ICommand _quitCommand;
|
||||
public ICommand QuitCommand
|
||||
{
|
||||
|
||||
@@ -91,13 +91,20 @@ namespace BodyshopPartner.ViewModels
|
||||
private async Task updateCheck()
|
||||
{
|
||||
logger.Debug("Checking if updates are available.");
|
||||
if (await Utils.UpdateHandler.AreUpdatesAvailable())
|
||||
UpdateAvailable = await Utils.UpdateHandler.AreUpdatesAvailable();
|
||||
if (UpdateAvailable)
|
||||
{
|
||||
logger.Debug("Updates are available! Installing.");
|
||||
await Utils.UpdateHandler.ApplyUpdates(Progress, Progress);
|
||||
string msg = "An update to ImEX Online Partner is Available";
|
||||
Utils.Notifications.notifier.ShowInformation(msg);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task InstallUpdates()
|
||||
{
|
||||
logger.Debug("Updates are available! Installing.");
|
||||
await Utils.UpdateHandler.ApplyUpdates(UpdateProgress, UpdateProgress);
|
||||
}
|
||||
|
||||
private async void _updateTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
|
||||
{
|
||||
await updateCheck();
|
||||
|
||||
@@ -63,5 +63,19 @@ namespace BodyshopPartner.ViewModels
|
||||
get { return _appVersion; }
|
||||
set { SetProperty(ref _appVersion, value); }
|
||||
}
|
||||
|
||||
private bool _updateAvailable = false;
|
||||
public bool UpdateAvailable
|
||||
{
|
||||
get { return _updateAvailable; }
|
||||
set { SetProperty(ref _updateAvailable, value); }
|
||||
}
|
||||
|
||||
private int _updateProgress;
|
||||
public int UpdateProgress
|
||||
{
|
||||
get { return _updateProgress; }
|
||||
set { SetProperty(ref _updateProgress, value); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user