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:
shannon@ShandemVaio
2012-07-21 00:20:50 +06:00
parent 8f278bcaa5
commit be51bfa67f
14 changed files with 129 additions and 169 deletions

View File

@@ -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>();
}
}
}