Class ConfigModelManager<TRootModel>
The main class of the Mastersign.ConfigModel library.
Inheritance
ConfigModelManager<TRootModel>
Assembly: Mastersign.ConfigModel.dll
Syntax
public class ConfigModelManager<TRootModel> : IDisposable where TRootModel : class, new()
Type Parameters
Name |
Description |
TRootModel |
The type of the root class of the configuration model tree.
|
Constructors
ConfigModelManager(StringComparison, PropertyNameHandling, TRootModel, YamlDeserializerBuildCustomizer, IReadOnlyDictionary<Type, IReadOnlyDictionary<string, Type>>, IReadOnlyDictionary<Type, Tuple<string, IReadOnlyDictionary<string, Type>>>, bool)
Declaration
public ConfigModelManager(StringComparison filenameComparison = StringComparison.Ordinal, PropertyNameHandling propertyNameHandling = PropertyNameHandling.PascalCase, TRootModel defaultModel = null, YamlDeserializerBuildCustomizer deserializationCustomizer = null, IReadOnlyDictionary<Type, IReadOnlyDictionary<string, Type>> typeDiscriminationsByPropertyExistence = null, IReadOnlyDictionary<Type, Tuple<string, IReadOnlyDictionary<string, Type>>> typeDiscriminationsByPropertyValue = null, bool withMergeKeys = false)
Parameters
ConfigModelManager(StringComparison, INamingConvention, TRootModel, YamlDeserializerBuildCustomizer, IReadOnlyDictionary<Type, IReadOnlyDictionary<string, Type>>, IReadOnlyDictionary<Type, Tuple<string, IReadOnlyDictionary<string, Type>>>, bool)
Declaration
public ConfigModelManager(StringComparison filenameComparison, INamingConvention propertyNamingConvention, TRootModel defaultModel, YamlDeserializerBuildCustomizer deserializationCustomizer, IReadOnlyDictionary<Type, IReadOnlyDictionary<string, Type>> typeDiscriminationsByPropertyExistence, IReadOnlyDictionary<Type, Tuple<string, IReadOnlyDictionary<string, Type>>> typeDiscriminationsByPropertyValue, bool withMergeKeys)
Parameters
Properties
IsWatching
Declaration
public bool IsWatching { get; }
Property Value
ReloadDelay
Declaration
public TimeSpan ReloadDelay { get; set; }
Property Value
Methods
AddLayer(string)
Declaration
public void AddLayer(string fileName)
Parameters
Type |
Name |
Description |
string |
fileName |
|
AddLayers(string, string)
Declaration
public void AddLayers(string filePattern, string rootPath = null)
Parameters
Dispose()
Declaration
~ConfigModelManager()
Declaration
protected ~ConfigModelManager()
GetIncludePatterns()
Declaration
public string[] GetIncludePatterns()
Returns
GetLayerPatterns()
Declaration
public string[] GetLayerPatterns()
Returns
GetLoadedIncludePaths()
Declaration
public string[] GetLoadedIncludePaths()
Returns
GetLoadedLayerPaths()
Declaration
public string[] GetLoadedLayerPaths()
Returns
GetLoadedStringSourcePaths()
Declaration
public string[] GetLoadedStringSourcePaths()
Returns
LoadModel()
Declaration
public TRootModel LoadModel()
Returns
Type |
Description |
TRootModel |
|
StopWatching()
Declaration
public void StopWatching()
WatchAndReload()
Starts watching for changes on any files, matching the glob patterns
added model layers, includes, and string sources.
Every time a change is detected the ReloadDelay is waited,
to filter out multiple change events in a short time,
then the model is reloaded.
When the reload was successful, the ModelChanged event is fired.
If the reload failed, the ModelReloadFailed event is fired.
Declaration
public void WatchAndReload()
Remarks
Exceptions
Events
ModelChanged
Declaration
public event ModelChangeHandler<TRootModel> ModelChanged
Event Type
ModelReloadFailed
Declaration
public event ModelReloadErrorHandler ModelReloadFailed
Event Type
Implements