Exemple #1
0
        private void ButtonCheckForUpdates_Click(object sender, RoutedEventArgs e)
        {
            Version latestVersion;

            try {
                latestVersion = UpdatesHelper.GetLatestVersion();
            } catch (CouldNotCheckForUpdatesException) {
                MessageBox.Show(Properties.Resources.messageBoxCheckForUpdatesError, "Bandcamp Downloader", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }

            Version currentVersion = Assembly.GetExecutingAssembly().GetName().Version;

            if (currentVersion.CompareTo(latestVersion) < 0)
            {
                // The latest version is newer than the current one
                var windowUpdate = new WindowUpdate()
                {
                    ShowInTaskbar         = true,
                    WindowStartupLocation = WindowStartupLocation.CenterScreen,
                };
                windowUpdate.Show();
            }
            else
            {
                MessageBox.Show(String.Format(Properties.Resources.messageBoxNoUpdateAvailable, currentVersion), "Bandcamp Downloader", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
        private void ButtonViewChangelog_Click(object sender, RoutedEventArgs e)
        {
            var windowUpdate = new WindowUpdate()
            {
                Owner                 = (Window)((Grid)Parent).Parent,
                ShowInTaskbar         = true,
                WindowStartupLocation = WindowStartupLocation.CenterScreen,
            };

            windowUpdate.Show();
        }
Exemple #3
0
        private void LabelNewVersion_MouseDown(object sender, MouseButtonEventArgs e)
        {
            var windowUpdate = new WindowUpdate()
            {
                Owner                 = this,
                ShowInTaskbar         = true,
                WindowStartupLocation = WindowStartupLocation.CenterScreen,
            };

            windowUpdate.Show();
        }
        private async void ButtonCheckForUpdates_Click(object sender, RoutedEventArgs e)
        {
            Version latestVersion;

            try {
                latestVersion = await UpdatesHelper.GetLatestVersionAsync();
            } catch (CouldNotCheckForUpdatesException) {
                var msgProperties = new WpfMessageBoxProperties()
                {
                    Button       = MessageBoxButton.OK,
                    ButtonOkText = Properties.Resources.messageBoxButtonOK,
                    Image        = MessageBoxImage.Error,
                    Text         = Properties.Resources.messageBoxCheckForUpdatesError,
                    Title        = "Bandcamp Downloader",
                };
                WpfMessageBox.Show(Window.GetWindow(this), ref msgProperties);

                return;
            }

            Version currentVersion = Assembly.GetExecutingAssembly().GetName().Version;

            if (currentVersion.CompareTo(latestVersion) < 0)
            {
                // The latest version is newer than the current one
                var windowUpdate = new WindowUpdate()
                {
                    ShowInTaskbar         = true,
                    WindowStartupLocation = WindowStartupLocation.CenterScreen,
                };
                windowUpdate.Show();
            }
            else
            {
                var msgProperties = new WpfMessageBoxProperties()
                {
                    Button       = MessageBoxButton.OK,
                    ButtonOkText = Properties.Resources.messageBoxButtonOK,
                    Image        = MessageBoxImage.Information,
                    Text         = String.Format(Properties.Resources.messageBoxNoUpdateAvailable, currentVersion.ToString(3)),
                    Title        = "Bandcamp Downloader",
                };
                WpfMessageBox.Show(Window.GetWindow(this), ref msgProperties);
            }
        }