Class BaseAlternateConfigurationFile
- Namespace
- Uncreated.Warfare.Configuration
- Assembly
- Uncreated.Warfare.dll
Allows deriving types to reference a configuration file.
public abstract class BaseAlternateConfigurationFile : IConfiguration, IDisposable
- Inheritance
-
BaseAlternateConfigurationFile
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
BaseAlternateConfigurationFile(string, bool)
Create a new configuration file reference.
protected BaseAlternateConfigurationFile(string fileName, bool mapSpecific = false)
Parameters
Properties
FilePath
Full path to the configuratin file.
public string FilePath { get; }
Property Value
this[string]
Gets or sets a configuration value.
public string? this[string key] { get; set; }
Parameters
keystringThe configuration key.
Property Value
- string
The configuration value.
UnderlyingConfiguration
The underlying configuration object.
public IConfiguration UnderlyingConfiguration { get; }
Property Value
Methods
GetChildren()
Gets the immediate descendant configuration sub-sections.
public IEnumerable<IConfigurationSection> GetChildren()
Returns
- IEnumerable<IConfigurationSection>
The configuration sub-sections.
GetReloadToken()
Returns a IChangeToken that can be used to observe when this configuration is reloaded.
public IChangeToken GetReloadToken()
Returns
GetSection(string)
Gets a configuration sub-section with the specified key.
public IConfigurationSection GetSection(string key)
Parameters
keystringThe key of the configuration section.
Returns
Remarks
This method will never return null. If no matching sub-section is found with the specified key,
an empty IConfigurationSection will be returned.
HandleChange()
Invoked by the base class when a change occurs.
protected virtual void HandleChange()
Events
OnChange
Invoked when this configuration file is updated.
public event Action<IConfiguration>? OnChange