private void onCheckForUpdatesTimer(object sender, System.Timers.ElapsedEventArgs e) { Trace.TraceInformation("[CheckForUpdates] Checking for updates on timer"); ISynchronizeInvoke synchronizeInvoke = (sender as System.Timers.Timer).SynchronizingObject; synchronizeInvoke.BeginInvoke(new Action(async() => { await StaticUpdateChecker.CheckForUpdatesAsync(Program.ServiceManager); if (StaticUpdateChecker.NewVersionInformation != null && StaticUpdateChecker.NewVersionInformation.VersionNumber != _previousNewVersionNumber) { _previousNewVersionNumber = StaticUpdateChecker.NewVersionInformation.VersionNumber; NewVersionAvailable?.Invoke(); } }), null); }
public bool CheckNewVersion() { if (sessions.Count > 0) { return(false); } // check file system string updateZip = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "update", "" + "nvs.7z"); if (File.Exists(updateZip)) { NewVersionAvailable.Set(); return(true); } return(false); }
public void Handle(NewVersionAvailable notification) { NotifyCenter(new NewSoftwareUpdateAvailableNotificationDataModel("New software version available", notification.Version.ToString())); }