public void CheckForUpdates() { if (!Configuration.CheckForUpdates || ProgramVersionInformation.Version == "devel") { State = UpdateManager.UpdateProcessState.NotChecked; return; } _updateManager.CheckForUpdateAsync(i => { State = UpdateManager.UpdateProcessState.Checked; HaveUpdatesAvailable = i > 0; if (HaveUpdatesAvailable) { UpdatesAvailable(this, new EventArgs()); } }); }
public void PrepareUpdates() { if(State != UpdateManager.UpdateProcessState.Checked) { throw new Exception("Invalid state. We need to check before preparing"); } _updateManager.PrepareUpdatesAsync(prepared => { State = UpdateManager.UpdateProcessState.Prepared; UpdatesReady(this, new EventArgs()); }); }