private void Application_Startup(object sender, StartupEventArgs e) { KoobooUpgrade.DeleteUpgradeRemainedFiles(); //第一次默认启动 if (KoobooAutoStart.IsFirstTimeAutoStart()) { KoobooAutoStart.AutoStart(true); } GlobalSettings.RootPath = Kooboo.Data.AppSettings.DatabasePath; KoobooStartUp.StartAll(); }
private void Application_Startup(object sender, StartupEventArgs e) { KoobooUpgrade.DeleteUpgradeRemainedFiles(); if (KoobooAutoStart.IsFirstBoot() || //first run default auto start KoobooAutoStart.IsAutoStart() || //override task when application path changed KoobooAutoStart.OldCodeHadSetAutoSart()) //compatible old code { KoobooAutoStart.AutoStart(true); } GlobalSettings.RootPath = Kooboo.Data.AppSettings.DatabasePath; KoobooStartUp.StartAll(); }
public async void UpdateVersionAsync() { var version = AppSettings.Version; var newversion = await KoobooUpgrade.GetLatestVersion(); Action action = () => { if (newversion > version) { update.Visibility = Visibility.Visible; update.Click += Upgrade_Click; update.Content = Data.Language.Hardcoded.GetValue("Upgrade") + string.Format("({0})", newversion.ToString()); } else { update.Visibility = Visibility.Hidden; currentVersion.Text = string.Format("{0}", version); } }; await this.Dispatcher.BeginInvoke(action); }
private async void Upgrade_Click(object sender, RoutedEventArgs e) { //防止重复点击 if (!IsUpgrade) { IsUpgrade = true; try { Action action = () => { SetUpgradeBtnStatus(); }; await this.Dispatcher.BeginInvoke(action); await KoobooUpgrade.Upgrade(DownloadProgressChanged); } finally { IsUpgrade = false; } } }
private void AutoUpgradeEvent(object sender, RoutedEventArgs e) { var auto = chAutoUpgrade.IsChecked.Value; KoobooUpgrade.SetAutoUpgrade(auto); }