Exemplo n.º 1
0
        /// <summary>
        /// アプリを更新するかどうかイベントを通して確認します。
        /// </summary>
        private bool OnDownloadDone(bool cancelled, Exception ex)
        {
            var e = new DownloadDoneEventArgs
            {
                IsUpdate          = false,
                ApplicationConfig = this.config,
                LatestVersion     = this.latestVersion,
                IsCancelled       = cancelled,
                Error             = ex,
            };

            DownloadDone.SafeRaiseEvent(this, e);
            return(e.IsUpdate);
        }
Exemplo n.º 2
0
        /// <summary>
        /// アプリを更新するかどうかイベントを通して確認します。
        /// </summary>
        private bool OnDownloadDone(bool cancelled, Exception ex)
        {
            var e = new DownloadDoneEventArgs
            {
                IsUpdate = false,
                ApplicationConfig = this.config,
                LatestVersion = this.latestVersion,
                IsCancelled = cancelled,
                Error = ex,
            };

            DownloadDone.SafeRaiseEvent(this, e);
            return e.IsUpdate;
        }
Exemplo n.º 3
0
        void updater_DownloadDone(object sender, DownloadDoneEventArgs e)
        {
            DownloadError = e.Error;

            if (e.IsCancelled)
            {
                return;
            }

            if (e.Error != null)
            {
                WPFUtil.UIProcess(() =>
                    DialogUtil.ShowError("更新ファイルのダウンロードに失敗しました。"));
                return;
            }

            WPFUtil.UIProcess(() =>
            {
                if (!this.updater.CanExecutePack())
                {
                    // 更新できません><
                    return;
                }

                if (this.progressWindow != null)
                {
                    this.progressWindow.Close();
                    this.progressWindow = null;
                }

                if (ConfirmUpdate(true))
                {
                    ExecuteUpdate();
                }
            });
            e.IsUpdate = false;
        }