Esempio n. 1
0
        /// <summary>
        /// Handle the Update Check Finishing.
        /// </summary>
        /// <param name="result">
        /// The result.
        /// </param>
        private void UpdateCheckDoneMenu(IAsyncResult result)
        {
            // Make sure it's running on the calling thread
            if (InvokeRequired)
            {
                Invoke(new MethodInvoker(() => this.UpdateCheckDoneMenu(result)));
                return;
            }
            UpdateCheckInformation info;
            try
            {
                // Get the information about the new build, if any, and close the window
                info = UpdateService.EndCheckForUpdates(result);

                if (info.NewVersionAvailable)
                {
                    UpdateInfo updateWindow = new UpdateInfo(
                        info,
                        userSettingService.GetUserSetting<string>(ASUserSettingConstants.HandBrakeVersion),
                        userSettingService.GetUserSetting<int>(ASUserSettingConstants.HandBrakeBuild));
                    updateWindow.ShowDialog();
                }
                else
                    MessageBox.Show("There are no new updates at this time.", "Update Check", MessageBoxButtons.OK,
                                    MessageBoxIcon.Information);
                lbl_updateCheck.Visible = false;
                return;
            }
            catch (Exception ex)
            {
                if ((bool)result.AsyncState)
                    MessageBox.Show(
                        "Unable to check for updates, Please try again later.\n\nDetailed Error Information:\n" + ex,
                        "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// When the update check is done, process the results.
        /// </summary>
        /// <param name="result">IAsyncResult result</param>
        private void UpdateCheckDone(IAsyncResult result)
        {
            if (InvokeRequired)
            {
                Invoke(new MethodInvoker(() => UpdateCheckDone(result)));
                return;
            }

            try
            {
                UpdateCheckInformation info = UpdateService.EndCheckForUpdates(result);

                if (info.NewVersionAvailable)
                {
                    UpdateInfo updateWindow = new UpdateInfo(info, userSettingService.GetUserSetting<string>(ASUserSettingConstants.HandBrakeVersion),
                        userSettingService.GetUserSetting<string>(ASUserSettingConstants.HandBrakeBuild));
                    updateWindow.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                if ((bool)result.AsyncState)
                    Main.ShowExceptiowWindow("Unable to check for updates, Please try again later.", ex.ToString());
            }
        }
Esempio n. 3
0
        /// <summary>
        /// When the update check is done, process the results.
        /// </summary>
        /// <param name="result">IAsyncResult result</param>
        private void UpdateCheckDone(IAsyncResult result)
        {
            if (InvokeRequired)
            {
                Invoke(new MethodInvoker(() => UpdateCheckDone(result)));
                return;
            }

            try
            {
                UpdateCheckInformation info = UpdateService.EndCheckForUpdates(result);

                if (info.NewVersionAvailable)
                {
                    UpdateInfo updateWindow = new UpdateInfo(info, userSettingService.GetUserSetting<string>(ASUserSettingConstants.HandBrakeVersion),
                        userSettingService.GetUserSetting<int>(ASUserSettingConstants.HandBrakeBuild));
                    updateWindow.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                if ((bool)result.AsyncState)
                    throw new GeneralApplicationException("Unable to check for updates.", "Please try again later. The service may currently be down or inaccessible. ", ex);
            }
        }
Esempio n. 4
0
        /// <summary>
        /// When the update check is done, process the results.
        /// </summary>
        /// <param name="result">IAsyncResult result</param>
        private void UpdateCheckDone(IAsyncResult result)
        {
            if (InvokeRequired)
            {
                Invoke(new MethodInvoker(() => UpdateCheckDone(result)));
                return;
            }

            try
            {
                UpdateCheckInformation info = UpdateService.EndCheckForUpdates(result);

                if (info.NewVersionAvailable)
                {
                    UpdateInfo updateWindow = new UpdateInfo(info, Settings.Default.hb_version, Settings.Default.hb_build.ToString());
                    updateWindow.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                if ((bool)result.AsyncState)
                    Main.ShowExceptiowWindow("Unable to check for updates, Please try again later.", ex.ToString());
            }
        }