Esempio n. 1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
#pragma warning disable CS4014 // We do not need to wait for this to complete before exiting our synchronized method. Fire and forget.
            TaskManager.Get.StartAsync(cancelToken => UpdateChecker.CheckForUpdates(cancelToken));
            //TaskManager.Get.StartAsync(cancelToken => PdbLoader.Load(cancelToken));
#pragma warning restore CS4014
        }
Esempio n. 2
0
        private void LaunchConsole(string[] args)
        {
            UpdateChecker.CheckForUpdates(AppProperties.GitHubBaseUrl);

            ConsoleEmbedder.ExecuteInsideConsole(() => Task.Run(() => Program.Main(args)).Wait());
            Shutdown();
        }
Esempio n. 3
0
        internal void CheckForUpdates()
        {
            if (updateChecker == null)
            {
                notificationService.Raise($"Update checking is disabled in the configuration file.",
                                          Severity.Info);
                return;
            }

            if (!updateChecker.CheckForUpdates())
            {
                var latest = updateChecker.LatestVersion;
                if (latest == null)
                {
                    notificationService.Raise($"Unable to find update information.",
                                              Severity.Info);
                }
                else
                {
                    notificationService.Raise($"No new updates available (latest available version is " +
                                              $"{latest.Value}).",
                                              Severity.Info);
                }
            }
        }
Esempio n. 4
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            MahApps.Metro.ThemeManager.IsAutomaticWindowsAppModeSettingSyncEnabled = true;
            MahApps.Metro.ThemeManager.SyncThemeWithWindowsAppModeSetting();

            if (!OS.IsCompatibleWindowsBuild)
            {
                MessageBox.Show(UI.Properties.Resources.IncompatibleWindows10Build, UI.Properties.Resources.IncompatibleWindows10BuildTitle);
                Current.Shutdown();
                return;
            }

            UpdateChecker.CheckForUpdates(AppProperties.GitHubBaseUrl);
            Current.ShutdownMode = ShutdownMode.OnLastWindowClose;

            if (e.Args.Any())
            {
                LaunchConsole(e.Args);
            }
            else
            {
                LaunchGui();
            }
        }
Esempio n. 5
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            UnGroupCheckBox(partyCheckBox, partyBox);
            UnGroupCheckBox(timeCheckBox, timeBox);
            Settings.Load();
            int lastSelectedApplication = Settings.Main.LastSelectedApplication;

            SetupApplicationList();
            if (lastSelectedApplication != -1 && lastSelectedApplication < appBox.Items.Count)
            {
                appBox.SelectedIndex = lastSelectedApplication;
            }
            handlers = new DiscordRpc.EventHandlers();

            if (Settings.Main.UpdateOnStartup)
            {
                updateButton_Click(this, new EventArgs());
            }

            UpdateChecker.CheckForUpdates();
            if (!UpdateChecker.IsUpToDate)
            {
                Font f = new Font(updatesToolStripMenuItem.Font, FontStyle.Bold);
                updatesToolStripMenuItem.Font = f;
            }
        }
Esempio n. 6
0
 static void Main(string[] args)
 {
     Loading.OnLoadingComplete += Loading_OnLoadingComplete;
     UpdateChecker.CheckForUpdates();
     while (UpdateChecker.CurrentVersion == System.Version.Parse("0.0.0.0"))
     {
     }
 }
Esempio n. 7
0
        private async void MainForm_Load(object sender, EventArgs e)
        {
            Text += " v" + Shared.VERSION.ToString(CultureInfo.InvariantCulture);
            ReadCurrentValues();

            _newRelease = await UpdateChecker.CheckForUpdates().ConfigureAwait(true);

            if (_newRelease != null)
            {
                btnUpdateAvailable.Visible = true;
                btnUpdateAvailable.Text    = "v" + _newRelease.tag_name + " is available!\r\nClick for changelog.";
            }
        }
Esempio n. 8
0
        private void CheckForUpdates()
        {
            var checker = new UpdateChecker();

            var progress = new UpdateCheckWindow();

            progress.Owner = MainWindow.Instance;
            progress.Show();

            JobExecutor.QueueJob(() => {
                var results = checker.CheckForUpdates(progress);
                progress.InvokeIfRequired(() => progress.ShowUpdateResults(results));
            });
        }
Esempio n. 9
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            MahApps.Metro.ThemeManager.IsAutomaticWindowsAppModeSettingSyncEnabled = true;
            MahApps.Metro.ThemeManager.SyncThemeWithWindowsAppModeSetting();
            UpdateChecker.CheckForUpdates(AppProperties.GitHubBaseUrl);

            if (e.Args.Any())
            {
                LaunchConsole(e.Args);
            }
            else
            {
                LaunchGui();
            }
        }
Esempio n. 10
0
 private void checkIfNew()
 {
     try
     {
         if (UpdateChecker.CheckForUpdates())
         {
             version.Dispatcher.BeginInvoke((Action)(() => version.Content = $"New version available! ({UpdateChecker.latest})"));
         }
         else
         {
             version.Dispatcher.BeginInvoke((Action)(() => version.Content = $"Up-to-date({UpdateChecker.latest})"));
         }
     } catch (Exception e)
     {
         version.Dispatcher.BeginInvoke((Action)(() => version.Content = $"Could not check latest version"));
     }
 }
Esempio n. 11
0
 private void UpdateCheck()
 {
     UpdateChecker.CheckForUpdates();
     if (!UpdateChecker.IsUpToDate && !shownUpdateNotification)
     {
         if (notifyIcon.Visible)
         {
             notifyIcon.BalloonTipTitle = "An update is available.";
             notifyIcon.BalloonTipText  = $"There's a new update for RichPresenceTest: {UpdateChecker.LatestStableVersion}";
             notifyIcon.ShowBalloonTip(10000);
         }
         else
         {
             updatesToolStripMenuItem_Click(this, new EventArgs());
         }
         shownUpdateNotification = true;
     }
 }
Esempio n. 12
0
        public static DependencyInjectionContainer CreateContainer()
        {
            var container = new DependencyInjectionContainer();

            IObservable <LogEvent> logEvents = null;

            IViewService viewService = new ViewService();

            Log.Logger = new LoggerConfiguration()
                         .WriteTo.RollingFile(@"Logs\Log-{Date}.txt")
                         .WriteTo.Observers(x => logEvents = x)
                         .MinimumLevel.Verbose()
                         .CreateLogger();

            UpdateChecker.CheckForUpdates(AppProperties.GitHubBaseUrl);

            var optionsProvider = new WindowsDeploymentOptionsProvider();

            container.Configure(x =>
            {
                x.Configure(optionsProvider);
                x.Export <DeviceProvider>().As <IDeviceProvider>().Lifestyle.Singleton();
                x.Export <WpfMarkdownDisplayer>().As <IMarkdownDisplayer>();
                x.ExportFactory(() => new BehaviorSubject <double>(double.NaN))
                .As <IObserver <double> >()
                .As <IObservable <double> >()
                .Lifestyle.Singleton();
                x.ExportFactory(() => logEvents).As <IObservable <LogEvent> >();
                x.Export <WimPickViewModel>().ByInterfaces().As <WimPickViewModel>().Lifestyle.Singleton();
                x.Export <AdvancedViewModel>().ByInterfaces().As <AdvancedViewModel>().Lifestyle.Singleton();
                x.Export <DeploymentViewModel>().ByInterfaces().As <DeploymentViewModel>().Lifestyle.Singleton();
                x.Export <UIServices>();
                x.ExportFactory(() => viewService).As <IViewService>();
                x.Export <Dialog>().ByInterfaces();
                x.Export <FilePicker>().As <IFilePicker>();
                x.Export <SettingsService>().As <ISettingsService>();
                x.ExportFactory(() => DialogCoordinator.Instance).As <IDialogCoordinator>();
            });

            return(container);
        }
Esempio n. 13
0
 private void DoUpdateCheck()
 {
     if (cbCheckForUpdates.Checked)
     {
         updateChecker.CheckForUpdates().ContinueWith(task =>
         {
             if (task.IsFaulted)
             {
                 Log.ErrorException("Error checking for updates", task.Exception);
             }
             else
             {
                 userConfigManager.Config.LastUpdateCheckDate = DateTime.Now;
                 userConfigManager.Save();
             }
             update = task.Result;
             hasCheckedForUpdates = true;
             SafeInvoke(UpdateControls);
         });
     }
 }
Esempio n. 14
0
 private void CheckForUpdate(string currentVersion)
 {
     try
     {
         var latestUpdate = UpdateChecker.CheckForUpdates("http://jdevillard.blob.core.windows.net/codeplex/amslogviewer/release.xml", UpdateFilter.Beta);
         if (latestUpdate != null)
         {
             _onlineVersion = latestUpdate;
             var latestVersion = latestUpdate.newversion.Replace(".", String.Empty);
             if (Int32.Parse(latestVersion) > Int32.Parse(currentVersion))
             {
                 IsNewVersionAvailable        = true;
                 AvailableVersion             = latestUpdate.newversion;
                 _aboutView.btnUpdate.Content = "Update";
             }
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
 private void btn7thCheckForUpdate_Click(object sender, RoutedEventArgs e)
 {
     CoreUpdater.CheckForUpdates(Sys.Settings.AppUpdateChannel, true);
 }
Esempio n. 16
0
 private void butUpdate_Click(object sender, EventArgs e)
 {
     UpdateChecker?.CheckForUpdates(UpdateNotifyMode.Always);
 }
Esempio n. 17
0
 static void Main(string[] args)
 {
     Loading.OnLoadingComplete += Loading_OnLoadingComplete;
     UpdateChecker.CheckForUpdates();
 }
Esempio n. 18
0
 public static void CheckForUpdatesMenu()
 {
     updateChecker.CheckForUpdates(automaticCheck: false);
 }
Esempio n. 19
0
        private void UpdateWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            UpdateChecker updateChecker = new UpdateChecker();

            e.Result = updateChecker.CheckForUpdates((string)e.Argument);
        }
 private void CheckForUpdates()
 {
     this.IsChecking = true;
     var checker = new UpdateChecker(this.UpdateChecked);
     checker.CheckForUpdates();
 }