Changed over Action to use PluginTypeResolver to find and instantiate IActionHandlers and included a unit test.
This commit is contained in:
27
src/umbraco.cms/PluginTypeResolverExtensions.cs
Normal file
27
src/umbraco.cms/PluginTypeResolverExtensions.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Core;
|
||||
using umbraco.BusinessLogic.Actions;
|
||||
using umbraco.businesslogic;
|
||||
using umbraco.interfaces;
|
||||
|
||||
namespace umbraco.cms
|
||||
{
|
||||
/// <summary>
|
||||
/// Extension methods for the PluginTypeResolver
|
||||
/// </summary>
|
||||
public static class PluginTypeResolverExtensions
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Returns all available IActionHandler in application
|
||||
/// </summary>
|
||||
/// <param name="resolver"></param>
|
||||
/// <returns></returns>
|
||||
internal static IEnumerable<Type> ResolveActions(this PluginTypeResolver resolver)
|
||||
{
|
||||
return resolver.ResolveTypes<IActionHandler>();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user