/// <summary> /// Gets the first plugin section. /// </summary> /// <typeparam name="TSection">The type of the section.</typeparam> /// <param name="manager">The manager.</param> /// <param name="sectionName">Name of the section.</param> /// <returns></returns> public static TSection GetFirstPluginSection <TSection>(this DeepConfigManager manager, string sectionName) where TSection : ConfigurationSection { var settings = PluginManagerConfiguration.GetSettings(); return(manager.GetFirstWebSetting <TSection, TSection>(sectionName, x => x, settings.PluginsPath)); }
/// <summary> /// Gets the first configuration setting matching <paramref name="sectionName"/> by calling <see cref="DeepConfigManager.GetWebSettings{TSection,TOut}(string,Func{TSection,TOut},string,string,string)"/>. /// See that method for an example. The relative plugin base path in <see cref="PluginManagerConfiguration.PluginsPath"/> is mapped to a physical path using the <see cref="System.Web.HttpContextWrapper"/> supplied to this instance /// <paramref name="manager"/> in its constructor. /// </summary> /// <typeparam name="TSection">The type of the section.</typeparam> /// <typeparam name="TOut">The type outputted by the expression in <paramref name="deferred"/>.</typeparam> /// <param name="manager">The manager.</param> /// <param name="sectionName">Name of the section in the configuration files.</param> /// <param name="deferred">The deffered expression.</param> /// <returns></returns> public static TOut GetFirstPluginSetting <TSection, TOut>(this DeepConfigManager manager, string sectionName, Expression <Func <TSection, TOut> > deferred) where TSection : ConfigurationSection where TOut : class { var settings = PluginManagerConfiguration.GetSettings(); return(manager.GetFirstWebSetting(sectionName, deferred, settings.PluginsPath)); }