/// <summary>
        /// Checks for program update and notifies the user if found
        /// </summary>
        private async void CheckForUpdate()
        {
            string result = await updater.GetUpdateUrl();

            if (result.StartsWith("https"))
            {
                MessageBoxResult mBoxResult = MessageBox.Show(
                    UPDATE_AVAILABLE_TEXT, UPDATE_AVAILABLE_CAPTION,
                    MessageBoxButton.YesNo, MessageBoxImage.Question,
                    MessageBoxResult.Yes, MessageBoxOptions.DefaultDesktopOnly);

                if (mBoxResult == MessageBoxResult.Yes)
                {
                    UpdateHandler updater      = new UpdateHandler();
                    bool          isOkToLaunch = await updater.DownloadUpdate(result);

                    if (isOkToLaunch)
                    {
                        updater.RunUpdate();
                    }
                }
            }
        }
示例#2
0
        private async void CheckUpdate()
        {
            string result = await update.GetUpdateUrl();

            SetUpdateLabel(result);
        }