Skip to content
This repository has been archived by the owner on Sep 11, 2023. It is now read-only.

Commit

Permalink
code beautify
Browse files Browse the repository at this point in the history
  • Loading branch information
maxijabase committed Apr 13, 2021
1 parent fe06215 commit 0234a77
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 32 deletions.
32 changes: 16 additions & 16 deletions Interop/OptionsControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Interop/TranslationProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class TranslationProvider
public bool IsDefault = true;


private readonly Dictionary<string, string> language = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
private readonly Dictionary<string, string> language = new(StringComparer.OrdinalIgnoreCase);

public string GetLanguage(string langID)
{
Expand Down
2 changes: 1 addition & 1 deletion Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion UI/Components/DASMElement.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
2 changes: 1 addition & 1 deletion UI/Components/EditorElementBracketHighlighter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions UI/Components/IntelliSenseController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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((?<class>[a-zA-Z_]([a-zA-Z0-9_]?)+)\.(?<method>[a-zA-Z_]([a-zA-Z0-9_]?)+)\()|((?<name>[a-zA-Z_]([a-zA-Z0-9_]?)+)\()",
RegexOptions.Compiled | RegexOptions.ExplicitCapture);

Expand All @@ -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;
Expand Down
10 changes: 4 additions & 6 deletions UI/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,22 @@ public partial class MainWindow
{
private readonly Storyboard BlendOverEffect;
private readonly Storyboard DisableServerAnim;
public readonly List<EditorElement> EditorsReferences = new List<EditorElement>();
public readonly List<EditorElement> EditorsReferences = new();
private readonly Storyboard EnableServerAnim;
private readonly Storyboard FadeFindReplaceGridIn;
private readonly Storyboard FadeFindReplaceGridOut;

private readonly bool FullyInitialized;

private ObservableCollection<string> actionButtonDict = new ObservableCollection<string>
private ObservableCollection<string> actionButtonDict = new()
{
Program.Translations.GetLanguage("Copy"), Program.Translations.GetLanguage("FTPUp"),
Program.Translations.GetLanguage("StartServer")
};

private ObservableCollection<string> compileButtonDict = new ObservableCollection<string>
{Program.Translations.GetLanguage("CompileAll"), Program.Translations.GetLanguage("CompileCurr")};
private ObservableCollection<string> compileButtonDict = new() { Program.Translations.GetLanguage("CompileAll"), Program.Translations.GetLanguage("CompileCurr")};

private ObservableCollection<string> findReplaceButtonDict = new ObservableCollection<string>
{Program.Translations.GetLanguage("Replace"), Program.Translations.GetLanguage("ReplaceAll")};
private ObservableCollection<string> findReplaceButtonDict = new() { Program.Translations.GetLanguage("Replace"), Program.Translations.GetLanguage("ReplaceAll")};

public MainWindow()
{
Expand Down
6 changes: 3 additions & 3 deletions UI/MainWindowSPCompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ namespace SPCode.UI
{
public partial class MainWindow
{
private readonly List<string> compiledFileNames = new List<string>();
private readonly List<string> compiledFiles = new List<string>();
private readonly List<string> nonUploadedFiles = new List<string>();
private readonly List<string> compiledFileNames = new();
private readonly List<string> compiledFiles = new();
private readonly List<string> nonUploadedFiles = new();

private bool InCompiling;
private Thread ServerCheckThread;
Expand Down
2 changes: 1 addition & 1 deletion UI/Windows/SPDefinitionWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down

0 comments on commit 0234a77

Please sign in to comment.