|
@@ -44,7 +44,7 @@ namespace Terminal.Gui.Configuration {
|
|
|
/// 3. Application configuration found in the applications's resources (<c>Resources/config.json</c>).
|
|
|
/// </para>
|
|
|
/// <para>
|
|
|
- /// 4. Global configuration found in the the user's home directory (<c>~/.tui/config.json</c>).
|
|
|
+ /// 4. Global configuration found in the user's home directory (<c>~/.tui/config.json</c>).
|
|
|
/// </para>
|
|
|
/// <para>
|
|
|
/// 5. Global configuration found in the directory the app was launched from (<c>./.tui/config.json</c>).
|
|
@@ -63,7 +63,7 @@ namespace Terminal.Gui.Configuration {
|
|
|
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
|
|
|
WriteIndented = true,
|
|
|
Converters = {
|
|
|
- // No need to set converterss - the ConfigRootConverter uses property attributes apply the correct
|
|
|
+ // No need to set converters - the ConfigRootConverter uses property attributes apply the correct
|
|
|
// Converter.
|
|
|
},
|
|
|
};
|
|
@@ -196,7 +196,7 @@ namespace Terminal.Gui.Configuration {
|
|
|
/// </summary>
|
|
|
/// <remarks>
|
|
|
/// Is <see langword="null"/> until <see cref="Reset"/> is called. Gets set to a new instance by
|
|
|
- /// deserializtion (see <see cref="Load"/>).
|
|
|
+ /// deserialization (see <see cref="Load"/>).
|
|
|
/// </remarks>
|
|
|
private static SettingsScope? _settings;
|
|
|
|
|
@@ -230,7 +230,7 @@ namespace Terminal.Gui.Configuration {
|
|
|
|
|
|
/// <summary>
|
|
|
/// Initializes the internal state of ConfiguraitonManager. Nominally called once as part of application
|
|
|
- /// startup to initilaize global state. Also called from some Unit Tests to ensure correctness (e.g. Reset()).
|
|
|
+ /// startup to initialize global state. Also called from some Unit Tests to ensure correctness (e.g. Reset()).
|
|
|
/// </summary>
|
|
|
internal static void Initialize ()
|
|
|
{
|
|
@@ -260,7 +260,7 @@ namespace Terminal.Gui.Configuration {
|
|
|
select p) {
|
|
|
if (p.GetCustomAttribute (typeof (SerializableConfigurationProperty)) is SerializableConfigurationProperty scp) {
|
|
|
if (p.GetGetMethod (true)!.IsStatic) {
|
|
|
- // If the class name is ommited, JsonPropertyName is allowed.
|
|
|
+ // If the class name is omitted, JsonPropertyName is allowed.
|
|
|
_allConfigProperties!.Add (scp.OmitClassName ? ConfigProperty.GetJsonPropertyName (p) : $"{p.DeclaringType?.Name}.{p.Name}", new ConfigProperty {
|
|
|
PropertyInfo = p,
|
|
|
PropertyValue = null
|
|
@@ -357,7 +357,7 @@ namespace Terminal.Gui.Configuration {
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Event fired when the configuration has been upddated from a configuration source.
|
|
|
+ /// Event fired when the configuration has been updated from a configuration source.
|
|
|
/// application.
|
|
|
/// </summary>
|
|
|
public static event Action<ConfigurationManagerEventArgs>? Updated;
|
|
@@ -378,7 +378,7 @@ namespace Terminal.Gui.Configuration {
|
|
|
}
|
|
|
|
|
|
ClearJsonErrors ();
|
|
|
-
|
|
|
+
|
|
|
Settings = new SettingsScope ();
|
|
|
ThemeManager.Reset ();
|
|
|
AppSettings = new AppScope ();
|
|
@@ -402,7 +402,7 @@ namespace Terminal.Gui.Configuration {
|
|
|
/// to generate the JSON doc that is embedded into Terminal.Gui (during development).
|
|
|
/// </para>
|
|
|
/// <para>
|
|
|
- /// WARNING: The <c>Terminal.Gui.Resources.config.json</c> resource has setting defintions (Themes)
|
|
|
+ /// WARNING: The <c>Terminal.Gui.Resources.config.json</c> resource has setting definitions (Themes)
|
|
|
/// that are NOT generated by this function. If you use this function to regenerate <c>Terminal.Gui.Resources.config.json</c>,
|
|
|
/// make sure you copy the Theme definitions from the existing <c>Terminal.Gui.Resources.config.json</c> file.
|
|
|
/// </para>
|
|
@@ -455,7 +455,7 @@ namespace Terminal.Gui.Configuration {
|
|
|
public static string AppName { get; set; } = Assembly.GetEntryAssembly ()?.FullName?.Split (',') [0]?.Trim ()!;
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Describes the location of the configuration files. The constancts can be
|
|
|
+ /// Describes the location of the configuration files. The constants can be
|
|
|
/// combined (bitwise) to specify multiple locations.
|
|
|
/// </summary>
|
|
|
[Flags]
|
|
@@ -488,7 +488,7 @@ namespace Terminal.Gui.Configuration {
|
|
|
public static ConfigLocations Locations { get; set; } = ConfigLocations.All;
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Loads all settings found in the various configuraiton storage locations to
|
|
|
+ /// Loads all settings found in the various configuration storage locations to
|
|
|
/// the <see cref="ConfigurationManager"/>. Optionally,
|
|
|
/// resets all settings attributed with <see cref="SerializableConfigurationProperty"/> to the defaults
|
|
|
/// defined in <see cref="LoadAppResources"/>.
|
|
@@ -508,7 +508,7 @@ namespace Terminal.Gui.Configuration {
|
|
|
if (Locations == ConfigLocations.All) {
|
|
|
var embeddedStylesResourceName = Assembly.GetEntryAssembly ()?
|
|
|
.GetManifestResourceNames ().FirstOrDefault (x => x.EndsWith (_configFilename));
|
|
|
- if (string.IsNullOrEmpty(embeddedStylesResourceName)) {
|
|
|
+ if (string.IsNullOrEmpty (embeddedStylesResourceName)) {
|
|
|
embeddedStylesResourceName = _configFilename;
|
|
|
}
|
|
|
|