/// <summary> /// Determines whether [is update available] [the specified sender]. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> private void IsUpdateAvailable(object sender, EventArgs e) { DispatcherTimer timer = sender as DispatcherTimer; timer?.Stop( ); if (UpdateHelper.DoesUpdateExist( )) { UpdateAvailable = true; } }
/// <summary> /// Checks for update. /// </summary> /// <returns></returns> public bool?CheckForUpdate( ) { if (UpdateHelper.DoesUpdateExist( )) { Application.App.UpdatePresent = true; var result = MessageBox.Show("ReadiMon Update available.\nDo you wish to update now?", "Update Available", MessageBoxButton.YesNo); if (result == MessageBoxResult.Yes) { Application.App.RestartReadiMonAfterUpdate = true; System.Windows.Application.Current.Shutdown( ); return(true); } return(null); } return(false); }
/// <summary> /// Raises the <see cref="E:System.Windows.Application.Startup" /> event. /// </summary> /// <param name="e">A <see cref="T:System.Windows.StartupEventArgs" /> that contains the event data.</param> protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; Current.Exit += Application_Exit; if (e.Args.Length > 0) { RunConsoleVersion(e.Args); } else { if (Settings.Default.AutoUpdate) { ThreadPool.QueueUserWorkItem(s => { UpdatePresent = UpdateHelper.DoesUpdateExist( ); }); } RunGuiVersion( ); } }