protected override void OnRunWorkerCompletedImpl(EventArgs <Version> result)
        {
            base.OnRunWorkerCompletedImpl(result);

            var hasException = result.Exception != null;

            if (!alwaysShow && hasException)
            {
                return;
            }

            var remoteVersion = hasException ? null : result.Value;

            var appInformationService = new ApplicationInformation();

            var localVersion = new Version(appInformationService.FileVersion);

            if (!hasException && !alwaysShow && localVersion == remoteVersion)
            {
                return;
            }

            var versionCheckWindow = new VersionCheckWindow();

            versionCheckWindow.ViewModel             = new VersionCheckWindowViewModel(versionCheckWindow, localVersion, remoteVersion);
            versionCheckWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            versionCheckWindow.Owner = owner;
            versionCheckWindow.Show();
        }
Beispiel #2
0
        private async Task CheckNewVersionAsync(Window window, bool exitApp)
        {
            var available = await this.Core.CheckNewVersionAsync();

            if (!available)
            {
                return;
            }

            bool?dialogResult = null;

            var dialog = new VersionCheckWindow()
            {
                WindowStartupLocation = WindowStartupLocation.CenterOwner,
                Owner = window,
            };

            dialogResult = dialog.ShowDialog();
            //if (window != null)
            //{
            //    window.PopupDialog.Show(new VersionCheckPopup(), new Thickness(0),
            //        HorizontalAlignment.Stretch, VerticalAlignment.Center, null, true);
            //}

            if (dialogResult == true)
            {
                Process.Start(this.Core.ProjectHomeUrl);
                if (exitApp)
                {
                    await this.ExitAllAfterLibraryUnLockedAsync();
                }
            }
        }
Beispiel #3
0
        private void PresentVersionDialog(Check versionCheck)
        {
            // we will now offer this version, so it is the new reference for "wait until next release"
            LastReturnedVersion = versionCheck.AvailableVersion;

            // reset (to 7 day checks)
            ReminderForNextRelease = false;

            // present dialog
            VersionCheckWindow dialog = new VersionCheckWindow
            {
                DataContext = new VersionCheckViewModel(versionCheck)
            };

            dialog.ShowDialog();
        }