aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2019-12-18 11:53:41 +0100
committerBond-009 <bond.009@outlook.com>2019-12-18 11:53:41 +0100
commita1ca50fd5a74eafa6e609976d90cad42b54137e5 (patch)
tree9c64d6914c27a8d7e2f8e6f71d7a5952197705cf /Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs
parent8723bdbb4fb73ed261ac1ba3b6932773e523d78b (diff)
parent6b185119aa329764c1ccc57d9be3e81f05680b69 (diff)
Merge branch 'namingtests' of https://github.com/Bond-009/jellyfin into namingtests
Diffstat (limited to 'Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs')
-rw-r--r--Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs16
1 files changed, 16 insertions, 0 deletions
diff --git a/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs b/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs
index 2a5d56c60..080cfbbd1 100644
--- a/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs
+++ b/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs
@@ -133,6 +133,10 @@ namespace Emby.Server.Implementations.AppBase
}
}
+ /// <summary>
+ /// Adds parts.
+ /// </summary>
+ /// <param name="factories">The configuration factories.</param>
public virtual void AddParts(IEnumerable<IConfigurationFactory> factories)
{
_configurationFactories = factories.ToArray();
@@ -247,6 +251,10 @@ namespace Emby.Server.Implementations.AppBase
}
}
+ /// <summary>
+ /// Ensures that we have write access to the path.
+ /// </summary>
+ /// <param name="path">The path.</param>
protected void EnsureWriteAccess(string path)
{
var file = Path.Combine(path, Guid.NewGuid().ToString());
@@ -259,6 +267,7 @@ namespace Emby.Server.Implementations.AppBase
return Path.Combine(CommonApplicationPaths.ConfigurationDirectoryPath, key.ToLowerInvariant() + ".xml");
}
+ /// <inheritdoc />
public object GetConfiguration(string key)
{
return _configurations.GetOrAdd(key, k =>
@@ -305,6 +314,7 @@ namespace Emby.Server.Implementations.AppBase
}
}
+ /// <inheritdoc />
public void SaveConfiguration(string key, object configuration)
{
var configurationStore = GetConfigurationStore(key);
@@ -341,6 +351,11 @@ namespace Emby.Server.Implementations.AppBase
OnNamedConfigurationUpdated(key, configuration);
}
+ /// <summary>
+ /// Event handler for when a named configuration has been updated.
+ /// </summary>
+ /// <param name="key">The key of the configuration.</param>
+ /// <param name="configuration">The old configuration.</param>
protected virtual void OnNamedConfigurationUpdated(string key, object configuration)
{
NamedConfigurationUpdated?.Invoke(this, new ConfigurationUpdateEventArgs
@@ -350,6 +365,7 @@ namespace Emby.Server.Implementations.AppBase
});
}
+ /// <inheritdoc />
public Type GetConfigurationType(string key)
{
return GetConfigurationStore(key)