Browse Source

Fix for reflection-based configuration

Brandon Thetford 1 year ago
parent
commit
e7b228a2c8
2 changed files with 4 additions and 1 deletions
  1. 2 1
      Terminal.Gui/Drawing/ColorScheme.Colors.cs
  2. 2 0
      Terminal.Gui/Terminal.Gui.csproj

+ 2 - 1
Terminal.Gui/Drawing/ColorScheme.Colors.cs

@@ -63,7 +63,8 @@ public sealed class Colors : INotifyCollectionChanged, IDictionary<string, Color
     /// </remarks>
     [SerializableConfigurationProperty (Scope = typeof (ThemeScope), OmitClassName = true)]
     [JsonConverter (typeof (DictionaryJsonConverter<ColorScheme?>))]
-    public static Dictionary<string, ColorScheme?> ColorSchemes { get; }
+    [UsedImplicitly]
+    public static Dictionary<string, ColorScheme?> ColorSchemes { get; private set; }
 
     /// <inheritdoc/>
     public IEnumerator<KeyValuePair<string, ColorScheme?>> GetEnumerator () { return ColorSchemes.GetEnumerator (); }

+ 2 - 0
Terminal.Gui/Terminal.Gui.csproj

@@ -38,6 +38,7 @@
   <!-- Dependencies -->
   <!-- =================================================================== -->
   <ItemGroup>
+    <PackageReference Include="JetBrains.Annotations" Version="2023.3.0" />
     <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="all" />
     <PackageReference Include="System.IO.Abstractions" Version="20.0.4" />
     <PackageReference Include="System.Text.Json" Version="8.0.1" />
@@ -83,6 +84,7 @@
   </ItemGroup>
   <ItemGroup>
     <Using Include="System.Text" />
+    <Using Include="JetBrains.Annotations" />
   </ItemGroup>
   <!-- =================================================================== -->
   <!-- Nuget  -->