Updated DataType factory to use PluginTypeResolver and made the dictionary thread safe.

Updated MacroEngineFactory to use PluginTypeResolver and made it thread safe. Have also
updated it to only create one instance of each IMacroEngine per application which should
increase performance a teeny bit, plus that's how it should be.
This commit is contained in:
shannon@ShandemVaio
2012-07-27 11:54:29 +06:00
parent 1823cce4f6
commit 5576f65ef0
9 changed files with 169 additions and 97 deletions

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using Umbraco.Core;
using umbraco.BusinessLogic.Actions;
using umbraco.businesslogic;
using umbraco.cms.businesslogic.macro;
using umbraco.interfaces;
namespace umbraco.cms
@@ -23,5 +24,25 @@ namespace umbraco.cms
return resolver.ResolveTypes<IActionHandler>();
}
/// <summary>
/// Returns all available IDataType in application
/// </summary>
/// <param name="resolver"></param>
/// <returns></returns>
internal static IEnumerable<Type> ResolveDataTypes(this PluginTypeResolver resolver)
{
return resolver.ResolveTypes<IDataType>();
}
/// <summary>
/// Returns all available IDataType in application
/// </summary>
/// <param name="resolver"></param>
/// <returns></returns>
internal static IEnumerable<Type> ResolveMacroEngines(this PluginTypeResolver resolver)
{
return resolver.ResolveTypes<IMacroEngine>();
}
}
}