diff options
| author | Andrew Rabert <ar@nullsum.net> | 2018-12-27 18:27:57 -0500 |
|---|---|---|
| committer | Andrew Rabert <ar@nullsum.net> | 2018-12-27 18:27:57 -0500 |
| commit | a86b71899ec52c44ddc6c3018e8cc5e9d7ff4d62 (patch) | |
| tree | a74f6ea4a8abfa1664a605d31d48bc38245ccf58 /MediaBrowser.Common/Configuration/IConfigurationManager.cs | |
| parent | 9bac3ac616b01f67db98381feb09d34ebe821f9a (diff) | |
Add GPL modules
Diffstat (limited to 'MediaBrowser.Common/Configuration/IConfigurationManager.cs')
| -rw-r--r-- | MediaBrowser.Common/Configuration/IConfigurationManager.cs | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/MediaBrowser.Common/Configuration/IConfigurationManager.cs b/MediaBrowser.Common/Configuration/IConfigurationManager.cs new file mode 100644 index 000000000..d826a3ee7 --- /dev/null +++ b/MediaBrowser.Common/Configuration/IConfigurationManager.cs @@ -0,0 +1,82 @@ +using MediaBrowser.Model.Configuration; +using System; +using System.Collections.Generic; + +namespace MediaBrowser.Common.Configuration +{ + public interface IConfigurationManager + { + /// <summary> + /// Occurs when [configuration updating]. + /// </summary> + event EventHandler<ConfigurationUpdateEventArgs> NamedConfigurationUpdating; + + /// <summary> + /// Occurs when [configuration updated]. + /// </summary> + event EventHandler<EventArgs> ConfigurationUpdated; + + /// <summary> + /// Occurs when [named configuration updated]. + /// </summary> + event EventHandler<ConfigurationUpdateEventArgs> NamedConfigurationUpdated; + + /// <summary> + /// Gets or sets the application paths. + /// </summary> + /// <value>The application paths.</value> + IApplicationPaths CommonApplicationPaths { get; } + + /// <summary> + /// Gets the configuration. + /// </summary> + /// <value>The configuration.</value> + BaseApplicationConfiguration CommonConfiguration { get; } + + /// <summary> + /// Saves the configuration. + /// </summary> + void SaveConfiguration(); + + /// <summary> + /// Replaces the configuration. + /// </summary> + /// <param name="newConfiguration">The new configuration.</param> + void ReplaceConfiguration(BaseApplicationConfiguration newConfiguration); + + /// <summary> + /// Gets the configuration. + /// </summary> + /// <param name="key">The key.</param> + /// <returns>System.Object.</returns> + object GetConfiguration(string key); + + /// <summary> + /// Gets the type of the configuration. + /// </summary> + /// <param name="key">The key.</param> + /// <returns>Type.</returns> + Type GetConfigurationType(string key); + + /// <summary> + /// Saves the configuration. + /// </summary> + /// <param name="key">The key.</param> + /// <param name="configuration">The configuration.</param> + void SaveConfiguration(string key, object configuration); + + /// <summary> + /// Adds the parts. + /// </summary> + /// <param name="factories">The factories.</param> + void AddParts(IEnumerable<IConfigurationFactory> factories); + } + + public static class ConfigurationManagerExtensions + { + public static T GetConfiguration<T>(this IConfigurationManager manager, string key) + { + return (T)manager.GetConfiguration(key); + } + } +} |
