Пример #1
0
        private void UpdateCheckCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            if (e.Cancelled || e.Error != null)
            {
                return;
            }

            var updateInfo = (UpdateInfo)e.Result;

            if (Updater.UpdateAvailable(updateInfo))
            {
                MetroUpdateDialog.Show(updateInfo, true);
            }
        }
Пример #2
0
        public static async Task BeginUpdateProcess()
        {
            var info = await GetBranchInfo();

            // If the request failed, tell the user to gtfo
            if (info == null)
            {
                App.AssemblyStorage.AssemblySettings.HomeWindow.Dispatcher.Invoke(new Action(
                                                                                      () =>
                                                                                      MetroMessageBox.Show("Update Check Failed",
                                                                                                           "Assembly is unable to check for updates at this time. Sorry :(")));
                return;
            }

            App.AssemblyStorage.AssemblySettings.HomeWindow.Dispatcher.Invoke(
                new Action(() => MetroUpdateDialog.Show(info, UpdateAvailable(info))));
        }
Пример #3
0
        public static void BeginUpdateProcess()
        {
            // Grab JSON Update package from the server
            UpdateInfo info = Updates.GetUpdateInfo();

            // If the request failed, tell the user to gtfo
            if (info == null || !info.Successful)
            {
                App.MetroIdeStorage.MetroIdeSettings.HomeWindow.Dispatcher.Invoke(new Action(
                                                                                      () =>
                                                                                      MetroMessageBox.Show("Update Check Failed",
                                                                                                           "MetroIde is unable to check for updates at this time. Sorry :(")));
                return;
            }

            App.MetroIdeStorage.MetroIdeSettings.HomeWindow.Dispatcher.Invoke(
                new Action(() => MetroUpdateDialog.Show(info, UpdateAvailable(info))));
        }
Пример #4
0
        private async Task CheckForUpdates()
        {
            // Grab JSON Update package from the server
            try
            {
                var result = await Updater.GetBranchInfo();

                if (result == null)
                {
                    return;
                }
                if (Updater.UpdateAvailable(result))
                {
                    MetroUpdateDialog.Show(result, true);
                }
            }
            catch
            {
            }
        }