mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
Updated code style for internal statics
This commit is contained in:
@@ -82,8 +82,10 @@ public static class ConfigurationManager
|
||||
/// <see cref="ConfigurationManager"/> to get and set the property's value.
|
||||
/// </summary>
|
||||
/// <remarks>Is <see langword="null"/> until <see cref="Initialize"/> is called.</remarks>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage ("Style", "IDE1006:Naming Styles", Justification = "<Pending>")]
|
||||
internal static Dictionary<string, ConfigProperty>? _allConfigProperties;
|
||||
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage ("Style", "IDE1006:Naming Styles", Justification = "<Pending>")]
|
||||
internal static readonly JsonSerializerOptions _serializerOptions = new ()
|
||||
{
|
||||
ReadCommentHandling = JsonCommentHandling.Skip,
|
||||
@@ -104,8 +106,10 @@ public static class ConfigurationManager
|
||||
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping
|
||||
};
|
||||
|
||||
internal static StringBuilder jsonErrors = new ();
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage ("Style", "IDE1006:Naming Styles", Justification = "<Pending>")]
|
||||
internal static StringBuilder _jsonErrors = new ();
|
||||
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage ("Style", "IDE1006:Naming Styles", Justification = "<Pending>")]
|
||||
private static readonly string _configFilename = "config.json";
|
||||
|
||||
/// <summary>The backing property for <see cref="Settings"/>.</summary>
|
||||
@@ -300,12 +304,12 @@ public static class ConfigurationManager
|
||||
/// <summary>Prints any Json deserialization errors that occurred during deserialization to the console.</summary>
|
||||
public static void PrintJsonErrors ()
|
||||
{
|
||||
if (jsonErrors.Length > 0)
|
||||
if (_jsonErrors.Length > 0)
|
||||
{
|
||||
Console.WriteLine (
|
||||
@"Terminal.Gui ConfigurationManager encountered the following errors while deserializing configuration files:"
|
||||
);
|
||||
Console.WriteLine (jsonErrors.ToString ());
|
||||
Console.WriteLine (_jsonErrors.ToString ());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -350,7 +354,7 @@ public static class ConfigurationManager
|
||||
internal static void AddJsonError (string error)
|
||||
{
|
||||
Debug.WriteLine ($"ConfigurationManager: {error}");
|
||||
jsonErrors.AppendLine (error);
|
||||
_jsonErrors.AppendLine (error);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -602,5 +606,5 @@ public static class ConfigurationManager
|
||||
return stream;
|
||||
}
|
||||
|
||||
private static void ClearJsonErrors () { jsonErrors.Clear (); }
|
||||
private static void ClearJsonErrors () { _jsonErrors.Clear (); }
|
||||
}
|
||||
|
||||
@@ -383,6 +383,9 @@
|
||||
<s:Boolean x:Key="/Default/CodeStyle/EditorConfig/ShowEditorConfigStatusBarIndicator/@EntryValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/EditorConfig/SyncToVisualStudio/@EntryValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/Naming/CSharpNaming/ApplyAutoDetectedRules/@EntryValue">False</s:Boolean>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticReadonly/@EntryIndexedValue"><Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PublicFields/@EntryIndexedValue"><Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=StaticReadonly/@EntryIndexedValue"><Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpUseContinuousIndentInsideBracesMigration/@EntryIndexedValue">True</s:Boolean>
|
||||
|
||||
@@ -41,6 +41,7 @@ public class ConfigurationManagerTests
|
||||
Assert.True (fired);
|
||||
|
||||
Applied -= ConfigurationManager_Applied;
|
||||
Reset ();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -176,6 +177,7 @@ public class ConfigurationManagerTests
|
||||
Assert.True (fired);
|
||||
|
||||
Updated -= ConfigurationManager_Updated;
|
||||
Reset ();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -264,6 +266,7 @@ public class ConfigurationManagerTests
|
||||
Assert.Equal (KeyCode.PageDown | KeyCode.CtrlMask, Application.AlternateForwardKey.KeyCode);
|
||||
Assert.Equal (KeyCode.PageUp | KeyCode.CtrlMask, Application.AlternateBackwardKey.KeyCode);
|
||||
Assert.False (Application.IsMouseDisabled);
|
||||
Reset ();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -537,7 +540,7 @@ public class ConfigurationManagerTests
|
||||
|
||||
Settings.Update ("{}}", "test");
|
||||
|
||||
Assert.NotEqual (0, jsonErrors.Length);
|
||||
Assert.NotEqual (0, _jsonErrors.Length);
|
||||
|
||||
Application.Shutdown ();
|
||||
|
||||
@@ -630,7 +633,7 @@ public class ConfigurationManagerTests
|
||||
jsonException = Assert.Throws<JsonException> (() => Settings.Update (json, "test"));
|
||||
Assert.StartsWith ("Unknown property", jsonException.Message);
|
||||
|
||||
Assert.Equal (0, jsonErrors.Length);
|
||||
Assert.Equal (0, _jsonErrors.Length);
|
||||
|
||||
ThrowOnJsonErrors = false;
|
||||
}
|
||||
@@ -813,6 +816,7 @@ public class ConfigurationManagerTests
|
||||
|
||||
Assert.Equal (new Color (Color.White), Colors.ColorSchemes ["Base"].Normal.Foreground);
|
||||
Assert.Equal (new Color (Color.Blue), Colors.ColorSchemes ["Base"].Normal.Background);
|
||||
Reset ();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
@@ -35,6 +35,7 @@ public class ThemeScopeTests
|
||||
|
||||
ThemeManager.Themes! [ThemeManager.SelectedTheme]!.Apply ();
|
||||
Assert.Equal (Dialog.ButtonAlignments.Right, Dialog.DefaultButtonAlignment);
|
||||
Reset ();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
Reference in New Issue
Block a user