diff --git a/App.xaml.cs b/App.xaml.cs index fec612e..bc065ed 100644 --- a/App.xaml.cs +++ b/App.xaml.cs @@ -60,10 +60,10 @@ public async void CheckVersion() { Version local = Assembly.GetExecutingAssembly().GetName().Version; if (local.CompareTo(latest) < 0) { - string message = "You are using an outdated version of FrostyFix. \nWould you like to download the latest version?"; + string message = $"You are using FrostyFix v{local.ToString()[..5]}. \nWould you like to download the latest version? (v{latest})"; MessageBoxResult Result = MessageBoxDialog.Show(message, "FrostyFix", MessageBoxButton.YesNo, DialogSound.Notify); if (Result == MessageBoxResult.Yes) { - Process.Start("https://github.com/Dyvinia/FrostyFix/releases/latest"); + Process.Start(new ProcessStartInfo("https://github.com/Dyvinia/FrostyFix/releases/latest") { UseShellExecute = true }); } } } diff --git a/Dialogs/ExceptionDialog.xaml.cs b/Dialogs/ExceptionDialog.xaml.cs index 4a10426..5424667 100644 --- a/Dialogs/ExceptionDialog.xaml.cs +++ b/Dialogs/ExceptionDialog.xaml.cs @@ -22,8 +22,6 @@ public ExceptionDialog(Exception ex, string title, bool isCrash, string messageP InitializeComponent(); Title = title; - Window mainWindow = Application.Current.MainWindow; - Icon = mainWindow.Icon; // Show or hide Header & Play according sounds int headerHeight = 30; diff --git a/Dialogs/MessageBoxDialog.xaml.cs b/Dialogs/MessageBoxDialog.xaml.cs index fa65f69..899c44a 100644 --- a/Dialogs/MessageBoxDialog.xaml.cs +++ b/Dialogs/MessageBoxDialog.xaml.cs @@ -28,13 +28,11 @@ public partial class MessageBoxDialog : Window { public MessageBoxDialog(string message, string title, MessageBoxButton buttons, DialogSound sound) { InitializeComponent(); - SetVisibilityOfButtons(buttons); + ButtonVisibility(buttons); PlaySound(sound); Title = title; MessageText.Text = message; - Window mainWindow = Application.Current.MainWindow; - Icon = mainWindow.Icon; OKButton.Click += OnClose; YesButton.Click += OnClose; @@ -45,7 +43,7 @@ public MessageBoxDialog(string message, string title, MessageBoxButton buttons, public static MessageBoxResult Show(string message, string title, MessageBoxButton buttons, DialogSound sound = DialogSound.None) { MessageBoxResult msgBoxResult = MessageBoxResult.None; Application.Current.Dispatcher.Invoke(() => { - MessageBoxDialog window = new MessageBoxDialog(message, title, buttons, sound); + MessageBoxDialog window = new(message, title, buttons, sound); window.ShowDialog(); msgBoxResult = window.result; }); @@ -66,7 +64,7 @@ private void OnClose(object sender, RoutedEventArgs e) { Close(); } - private void SetVisibilityOfButtons(MessageBoxButton button) { + private void ButtonVisibility(MessageBoxButton button) { switch (button) { case MessageBoxButton.OK: CancelButton.Visibility = Visibility.Collapsed;