Files
Umbraco-CMS/src/Umbraco.Web/PluginTypeResolverExtensions.cs
shannon@ShandemVaio 5da0445c32 Updated TreeDefinitionCollection to use PluginTypeResolver and fixed its code to be thread safe.
Updated restExtensions to use PluginTypeResolver and added unit test for resolving these types.
Updated TypeFinder2 with a slight perf increase.
2012-07-31 01:56:03 +06:00

37 lines
989 B
C#

using System;
using System.Collections.Generic;
using System.Threading;
using Umbraco.Core;
using Umbraco.Web.Routing;
using umbraco.interfaces;
using umbraco.presentation.umbracobase;
namespace Umbraco.Web
{
/// <summary>
/// Extension methods for the PluginTypeResolver
/// </summary>
public static class PluginTypeResolverExtensions
{
/// <summary>
/// Returns all available ITrees in application
/// </summary>
/// <param name="resolver"></param>
/// <returns></returns>
internal static IEnumerable<Type> ResolveTrees(this PluginTypeResolver resolver)
{
return resolver.ResolveTypes<ITree>();
}
/// <summary>
/// Returns all classes attributed with RestExtension attribute
/// </summary>
/// <param name="resolver"></param>
/// <returns></returns>
internal static IEnumerable<Type> ResolveRestExtensions(this PluginTypeResolver resolver)
{
return resolver.ResolveAttributedTypes<RestExtension>();
}
}
}