Renamed config interfaces properly with Section suffix, re-implemented the For<T> UmbracoConfiguration method to retreive specific settings... might use this entirely instead of the nested access as it might make it easier to mock.
This commit is contained in:
@@ -8,6 +8,7 @@ using System.Text;
|
||||
using System.Threading;
|
||||
using System.Web.Compilation;
|
||||
using System.Xml.Linq;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Models;
|
||||
@@ -445,7 +446,18 @@ namespace Umbraco.Core
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns all classes attributed with XsltExtensionAttribute attribute
|
||||
/// Returns all classes of type IUmbracoConfigurationSection
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
internal IEnumerable<Type> ResolveUmbracoConfigurationSections()
|
||||
{
|
||||
//don't cache the result since it's a one time lookup for a type anyways
|
||||
//ONLY look in the CORE assembly for performance.
|
||||
return ResolveTypes<IUmbracoConfigurationSection>(false, new[] { typeof(IUmbracoConfigurationSection).Assembly });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns all classes of type ICacheRefresher
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
internal IEnumerable<Type> ResolveCacheRefreshers()
|
||||
@@ -729,10 +741,10 @@ namespace Umbraco.Core
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <returns></returns>
|
||||
internal IEnumerable<Type> ResolveTypes<T>(bool cacheResult = true)
|
||||
internal IEnumerable<Type> ResolveTypes<T>(bool cacheResult = true, IEnumerable<Assembly> specificAssemblies = null)
|
||||
{
|
||||
return ResolveTypes<T>(
|
||||
() => TypeFinder.FindClassesOfType<T>(AssembliesToScan),
|
||||
() => TypeFinder.FindClassesOfType<T>(specificAssemblies ?? AssembliesToScan),
|
||||
TypeResolutionKind.FindAllTypes,
|
||||
cacheResult);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user