From 0082e157d77e360c9e8e582e87b515023bf1a10b Mon Sep 17 00:00:00 2001 From: Anna Date: Fri, 27 Nov 2020 19:37:34 -0500 Subject: [PATCH] refactor(desktop): clean up unused code/fix warnings --- XIVChat Desktop/AssemblyInfo.cs | 10 ---------- XIVChat Desktop/ConfigWindow.xaml.cs | 6 +----- XIVChat Desktop/ConnectDialog.xaml.cs | 7 +------ XIVChat Desktop/Converters.cs | 2 +- XIVChat Desktop/LicenceWindow.xaml.cs | 6 +----- XIVChat Desktop/ManageServer.xaml.cs | 7 +------ XIVChat Desktop/Notifications.cs | 2 +- XIVChat Desktop/TrustDialog.xaml.cs | 7 +------ 8 files changed, 7 insertions(+), 40 deletions(-) delete mode 100644 XIVChat Desktop/AssemblyInfo.cs diff --git a/XIVChat Desktop/AssemblyInfo.cs b/XIVChat Desktop/AssemblyInfo.cs deleted file mode 100644 index 8b5504e..0000000 --- a/XIVChat Desktop/AssemblyInfo.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Windows; - -[assembly: ThemeInfo( - ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located - //(used if a resource is not found in the page, - // or application resource dictionaries) - ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located - //(used if a resource is not found in the page, - // app, or any theme specific resource dictionaries) -)] diff --git a/XIVChat Desktop/ConfigWindow.xaml.cs b/XIVChat Desktop/ConfigWindow.xaml.cs index 71fa4ac..30c0a7b 100644 --- a/XIVChat Desktop/ConfigWindow.xaml.cs +++ b/XIVChat Desktop/ConfigWindow.xaml.cs @@ -41,12 +41,8 @@ namespace XIVChat_Desktop { new ManageServer(this, server).ShowDialog(); } - private void ConfigWindow_OnContentRendered(object? sender, EventArgs e) { - this.InvalidateVisual(); - } - private void NumericInputFilter(object sender, TextCompositionEventArgs e) { - var allDigits = e.Text.All(c => char.IsDigit(c)); + var allDigits = e.Text.All(char.IsDigit); e.Handled = !allDigits; } diff --git a/XIVChat Desktop/ConnectDialog.xaml.cs b/XIVChat Desktop/ConnectDialog.xaml.cs index 00584e1..bcfce4d 100644 --- a/XIVChat Desktop/ConnectDialog.xaml.cs +++ b/XIVChat Desktop/ConnectDialog.xaml.cs @@ -1,5 +1,4 @@ -using System; -using System.Windows; +using System.Windows; namespace XIVChat_Desktop { /// @@ -36,9 +35,5 @@ namespace XIVChat_Desktop { this.Close(); } - - private void ConnectDialog_OnContentRendered(object? sender, EventArgs e) { - this.InvalidateVisual(); - } } } diff --git a/XIVChat Desktop/Converters.cs b/XIVChat Desktop/Converters.cs index 60cc6f6..fb1120e 100644 --- a/XIVChat Desktop/Converters.cs +++ b/XIVChat Desktop/Converters.cs @@ -69,7 +69,7 @@ namespace XIVChat_Desktop { return s.ToString(); } - public object? ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } } diff --git a/XIVChat Desktop/LicenceWindow.xaml.cs b/XIVChat Desktop/LicenceWindow.xaml.cs index 79ea25a..e959a7c 100644 --- a/XIVChat Desktop/LicenceWindow.xaml.cs +++ b/XIVChat Desktop/LicenceWindow.xaml.cs @@ -71,7 +71,7 @@ namespace XIVChat_Desktop { this.Close(); } - private static async Task LicenceInfo(string key, bool increment = false) { + internal static async Task LicenceInfo(string key, bool increment = false) { var uri = new Uri("https://api.gumroad.com/v2/licenses/verify"); var data = new Dictionary { ["product_permalink"] = "kvQIw", @@ -85,10 +85,6 @@ namespace XIVChat_Desktop { return response; } - - private void LicenceWindow_OnContentRendered(object? sender, EventArgs e) { - this.InvalidateVisual(); - } } [JsonObject(NamingStrategyType = typeof(SnakeCaseNamingStrategy))] diff --git a/XIVChat Desktop/ManageServer.xaml.cs b/XIVChat Desktop/ManageServer.xaml.cs index dbf6a68..e00c70c 100644 --- a/XIVChat Desktop/ManageServer.xaml.cs +++ b/XIVChat Desktop/ManageServer.xaml.cs @@ -1,5 +1,4 @@ -using System; -using System.Windows; +using System.Windows; namespace XIVChat_Desktop { /// @@ -73,9 +72,5 @@ namespace XIVChat_Desktop { private void Cancel_Click(object sender, RoutedEventArgs e) { this.Close(); } - - private void ManageServer_OnContentRendered(object? sender, EventArgs e) { - this.InvalidateVisual(); - } } } diff --git a/XIVChat Desktop/Notifications.cs b/XIVChat Desktop/Notifications.cs index b0c3527..3d90e00 100644 --- a/XIVChat Desktop/Notifications.cs +++ b/XIVChat Desktop/Notifications.cs @@ -2,7 +2,7 @@ using Microsoft.Toolkit.Uwp.Notifications; namespace XIVChat_Desktop { - public class Notifications { + public static class Notifications { public static void Initialise() { DesktopNotificationManagerCompat.RegisterAumidAndComServer("XIVChat.XIVChat_Desktop"); DesktopNotificationManagerCompat.RegisterActivator(); diff --git a/XIVChat Desktop/TrustDialog.xaml.cs b/XIVChat Desktop/TrustDialog.xaml.cs index aa90f04..8a9b0e8 100644 --- a/XIVChat Desktop/TrustDialog.xaml.cs +++ b/XIVChat Desktop/TrustDialog.xaml.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using System.Threading.Channels; using System.Windows; @@ -75,9 +74,5 @@ namespace XIVChat_Desktop { await this.trustChannel.WriteAsync(false); this.Close(); } - - private void TrustDialog_OnContentRendered(object? sender, EventArgs e) { - this.InvalidateVisual(); - } } }