Changed RoutingEnvironment to RoutingContet. Cleaned up how the context reference each other, now
this starts making a bunch of sense. Have empty ctor's on all ILookups since their methods get passed a DocumentRequest object which has access to all of the context's and properties that they will ever need.
This commit is contained in:
@@ -13,7 +13,7 @@ namespace Umbraco.Web
|
||||
public static class PluginResolverExtensions
|
||||
{
|
||||
|
||||
private static volatile IEnumerable<ILookup> _lookups;
|
||||
private static volatile IEnumerable<Type> _lookups;
|
||||
private static readonly object Locker = new object();
|
||||
|
||||
/// <summary>
|
||||
@@ -21,7 +21,7 @@ namespace Umbraco.Web
|
||||
/// </summary>
|
||||
/// <param name="plugins"></param>
|
||||
/// <returns></returns>
|
||||
internal static IEnumerable<ILookup> ResolveLookups(this PluginResolver plugins)
|
||||
internal static IEnumerable<Type> ResolveLookups(this PluginResolver plugins)
|
||||
{
|
||||
if (_lookups == null)
|
||||
{
|
||||
@@ -29,22 +29,7 @@ namespace Umbraco.Web
|
||||
{
|
||||
if (_lookups == null)
|
||||
{
|
||||
var lookupTypes = TypeFinder.FindClassesOfType<ILookup>();
|
||||
var lookups = new List<ILookup>();
|
||||
foreach (var l in lookupTypes)
|
||||
{
|
||||
try
|
||||
{
|
||||
var typeInstance = Activator.CreateInstance(l) as ILookup;
|
||||
lookups.Add(typeInstance);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Add(LogTypes.Error, -1, "Error loading ILookup: " + ex.ToString());
|
||||
}
|
||||
}
|
||||
//set the global
|
||||
_lookups = lookups;
|
||||
_lookups = TypeFinder.FindClassesOfType<ILookup>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user