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:
@@ -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>();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user