diff --git a/Interop/OptionsControl.cs b/Interop/OptionsControl.cs index 59e9f5d2..b2e8d1c8 100644 --- a/Interop/OptionsControl.cs +++ b/Interop/OptionsControl.cs @@ -51,25 +51,25 @@ public class OptionsControl public bool Program_UseHardwareAcceleration = true; public bool Program_UseHardwareSalts = true; - public SerializeableColor SH_Chars = new SerializeableColor(0xFF, 0xD6, 0x9C, 0x85); + public SerializeableColor SH_Chars = new(0xFF, 0xD6, 0x9C, 0x85); - public SerializeableColor SH_Comments = new SerializeableColor(0xFF, 0x57, 0xA6, 0x49); - public SerializeableColor SH_CommentsMarker = new SerializeableColor(0xFF, 0xFF, 0x20, 0x20); - public SerializeableColor SH_Constants = new SerializeableColor(0xFF, 0xBC, 0x62, 0xC5); - public SerializeableColor SH_ContextKeywords = new SerializeableColor(0xFF, 0x56, 0x9C, 0xD5); - public SerializeableColor SH_Deprecated = new SerializeableColor(0xFF, 0xFF, 0x00, 0x00); - public SerializeableColor SH_Functions = new SerializeableColor(0xFF, 0x56, 0x9C, 0xD5); + public SerializeableColor SH_Comments = new(0xFF, 0x57, 0xA6, 0x49); + public SerializeableColor SH_CommentsMarker = new(0xFF, 0xFF, 0x20, 0x20); + public SerializeableColor SH_Constants = new(0xFF, 0xBC, 0x62, 0xC5); + public SerializeableColor SH_ContextKeywords = new(0xFF, 0x56, 0x9C, 0xD5); + public SerializeableColor SH_Deprecated = new(0xFF, 0xFF, 0x00, 0x00); + public SerializeableColor SH_Functions = new(0xFF, 0x56, 0x9C, 0xD5); public bool SH_HighlightDeprecateds = true; - public SerializeableColor SH_Keywords = new SerializeableColor(0xFF, 0x56, 0x9C, 0xD5); - public SerializeableColor SH_Methods = new SerializeableColor(0xFF, 0x3B, 0xC6, 0x7E); - public SerializeableColor SH_Numbers = new SerializeableColor(0xFF, 0x97, 0x97, 0x97); - public SerializeableColor SH_PreProcessor = new SerializeableColor(0xFF, 0x7E, 0x7E, 0x7E); - public SerializeableColor SH_SpecialCharacters = new SerializeableColor(0xFF, 0x8F, 0x8F, 0x8F); - public SerializeableColor SH_Strings = new SerializeableColor(0xFF, 0xF4, 0x6B, 0x6C); - public SerializeableColor SH_Types = new SerializeableColor(0xFF, 0x28, 0x90, 0xB0); //56 9C D5 - public SerializeableColor SH_TypesValues = new SerializeableColor(0xFF, 0x56, 0x9C, 0xD5); - public SerializeableColor SH_UnkownFunctions = new SerializeableColor(0xFF, 0x45, 0x85, 0xC5); + public SerializeableColor SH_Keywords = new(0xFF, 0x56, 0x9C, 0xD5); + public SerializeableColor SH_Methods = new(0xFF, 0x3B, 0xC6, 0x7E); + public SerializeableColor SH_Numbers = new(0xFF, 0x97, 0x97, 0x97); + public SerializeableColor SH_PreProcessor = new(0xFF, 0x7E, 0x7E, 0x7E); + public SerializeableColor SH_SpecialCharacters = new(0xFF, 0x8F, 0x8F, 0x8F); + public SerializeableColor SH_Strings = new(0xFF, 0xF4, 0x6B, 0x6C); + public SerializeableColor SH_Types = new(0xFF, 0x28, 0x90, 0xB0); //56 9C D5 + public SerializeableColor SH_TypesValues = new(0xFF, 0x56, 0x9C, 0xD5); + public SerializeableColor SH_UnkownFunctions = new(0xFF, 0x45, 0x85, 0xC5); public bool UI_Animations = true; public bool UI_ShowToolBar; diff --git a/Interop/TranslationProvider.cs b/Interop/TranslationProvider.cs index 94765b04..60b9f81e 100644 --- a/Interop/TranslationProvider.cs +++ b/Interop/TranslationProvider.cs @@ -14,7 +14,7 @@ public class TranslationProvider public bool IsDefault = true; - private readonly Dictionary language = new Dictionary(StringComparer.OrdinalIgnoreCase); + private readonly Dictionary language = new(StringComparer.OrdinalIgnoreCase); public string GetLanguage(string langID) { diff --git a/Program.cs b/Program.cs index 5fafe6c2..4aa4dc20 100644 --- a/Program.cs +++ b/Program.cs @@ -30,7 +30,7 @@ public static class Program public static UpdateInfo UpdateStatus; public static bool RCCKMade; - public static DiscordRpcClient discordClient = new DiscordRpcClient(Constants.DiscordRPCAppID); + public static DiscordRpcClient discordClient = new(Constants.DiscordRPCAppID); public static Timestamps discordTime = Timestamps.Now; public static string Indentation => OptionsObject.Editor_ReplaceTabsToWhitespace diff --git a/UI/Components/DASMElement.xaml.cs b/UI/Components/DASMElement.xaml.cs index 4b6f28d7..903a0fe3 100644 --- a/UI/Components/DASMElement.xaml.cs +++ b/UI/Components/DASMElement.xaml.cs @@ -17,7 +17,7 @@ public partial class DASMElement : UserControl private double LineHeight = 0.0; private SmxFile file_; - private readonly StringBuilder detail_buffer_ = new StringBuilder(); + private readonly StringBuilder detail_buffer_ = new(); public DASMElement() { diff --git a/UI/Components/EditorElementBracketHighlighter.cs b/UI/Components/EditorElementBracketHighlighter.cs index ff46bbd9..c4f1424b 100644 --- a/UI/Components/EditorElementBracketHighlighter.cs +++ b/UI/Components/EditorElementBracketHighlighter.cs @@ -96,7 +96,7 @@ public class SPBracketSearcher : IBracketSearcher private bool isCommentLine; private bool isString; private bool isChar; - public BracketHighlightHelpers bracketHelper = new BracketHighlightHelpers(); + public BracketHighlightHelpers bracketHelper = new(); #endregion diff --git a/UI/Components/IntelliSenseController.cs b/UI/Components/IntelliSenseController.cs index 9c7395ba..dc6d97b3 100644 --- a/UI/Components/IntelliSenseController.cs +++ b/UI/Components/IntelliSenseController.cs @@ -32,7 +32,7 @@ public partial class EditorElement public bool ISAC_Open; private ISNode[] isEntrys; - private readonly Regex ISFindRegex = new Regex( + private readonly Regex ISFindRegex = new( @"\b((?[a-zA-Z_]([a-zA-Z0-9_]?)+)\.(?[a-zA-Z_]([a-zA-Z0-9_]?)+)\()|((?[a-zA-Z_]([a-zA-Z0-9_]?)+)\()", RegexOptions.Compiled | RegexOptions.ExplicitCapture); @@ -41,7 +41,7 @@ public partial class EditorElement // TODO Add EnumStructs private SMMethodmap[] methodMaps; - private readonly Regex multilineCommentRegex = new Regex(@"/\*.*?\*/", + private readonly Regex multilineCommentRegex = new(@"/\*.*?\*/", RegexOptions.Compiled | RegexOptions.ExplicitCapture | RegexOptions.Singleline); //private string[] methodNames; diff --git a/UI/MainWindow.xaml.cs b/UI/MainWindow.xaml.cs index 17d1a84e..ea39f7d6 100644 --- a/UI/MainWindow.xaml.cs +++ b/UI/MainWindow.xaml.cs @@ -25,24 +25,22 @@ public partial class MainWindow { private readonly Storyboard BlendOverEffect; private readonly Storyboard DisableServerAnim; - public readonly List EditorsReferences = new List(); + public readonly List EditorsReferences = new(); private readonly Storyboard EnableServerAnim; private readonly Storyboard FadeFindReplaceGridIn; private readonly Storyboard FadeFindReplaceGridOut; private readonly bool FullyInitialized; - private ObservableCollection actionButtonDict = new ObservableCollection + private ObservableCollection actionButtonDict = new() { Program.Translations.GetLanguage("Copy"), Program.Translations.GetLanguage("FTPUp"), Program.Translations.GetLanguage("StartServer") }; - private ObservableCollection compileButtonDict = new ObservableCollection - {Program.Translations.GetLanguage("CompileAll"), Program.Translations.GetLanguage("CompileCurr")}; + private ObservableCollection compileButtonDict = new() { Program.Translations.GetLanguage("CompileAll"), Program.Translations.GetLanguage("CompileCurr")}; - private ObservableCollection findReplaceButtonDict = new ObservableCollection - {Program.Translations.GetLanguage("Replace"), Program.Translations.GetLanguage("ReplaceAll")}; + private ObservableCollection findReplaceButtonDict = new() { Program.Translations.GetLanguage("Replace"), Program.Translations.GetLanguage("ReplaceAll")}; public MainWindow() { diff --git a/UI/MainWindowSPCompiler.cs b/UI/MainWindowSPCompiler.cs index ab7b24d7..21b76c8e 100644 --- a/UI/MainWindowSPCompiler.cs +++ b/UI/MainWindowSPCompiler.cs @@ -14,9 +14,9 @@ namespace SPCode.UI { public partial class MainWindow { - private readonly List compiledFileNames = new List(); - private readonly List compiledFiles = new List(); - private readonly List nonUploadedFiles = new List(); + private readonly List compiledFileNames = new(); + private readonly List compiledFiles = new(); + private readonly List nonUploadedFiles = new(); private bool InCompiling; private Thread ServerCheckThread; diff --git a/UI/Windows/SPDefinitionWindow.xaml.cs b/UI/Windows/SPDefinitionWindow.xaml.cs index ed7c2a92..25a968b5 100644 --- a/UI/Windows/SPDefinitionWindow.xaml.cs +++ b/UI/Windows/SPDefinitionWindow.xaml.cs @@ -22,7 +22,7 @@ public partial class SPDefinitionWindow private readonly SMBaseDefinition[] defArray; private readonly Brush errorSearchBoxBrush = new SolidColorBrush(Color.FromArgb(0x50, 0xA0, 0x30, 0)); private readonly ListViewItem[] items; - private readonly Timer searchTimer = new Timer(1000.0); + private readonly Timer searchTimer = new(1000.0); public SPDefinitionWindow() {