Cleanup trees

This commit is contained in:
Stephan
2019-01-22 09:31:47 +01:00
parent a53a15f4d8
commit ad026e25d7
37 changed files with 277 additions and 300 deletions

View File

@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using Umbraco.Core.Media;
using Umbraco.Web.Mvc;
using Umbraco.Web.Trees;
using Umbraco.Web.WebApi;
using Umbraco.Core.Composing;
@@ -10,29 +8,20 @@ using Umbraco.Core.Composing;
namespace Umbraco.Web
{
/// <summary>
/// Extension methods for the PluginTypemgr
/// Provides extension methods for the <see cref="TypeLoader"/> class.
/// </summary>
public static class TypeLoaderExtensions
{
/// <summary>
/// Returns all available TreeApiController's in application that are attribute with TreeAttribute
/// Gets all types implementing <see cref="SurfaceController"/>.
/// </summary>
/// <param name="mgr"></param>
/// <returns></returns>
internal static IEnumerable<Type> GetAttributedTreeControllers(this TypeLoader mgr)
{
return mgr.GetTypesWithAttribute<TreeController, TreeAttribute>();
}
internal static IEnumerable<Type> GetSurfaceControllers(this TypeLoader typeLoader)
=> typeLoader.GetTypes<SurfaceController>();
internal static IEnumerable<Type> GetSurfaceControllers(this TypeLoader mgr)
{
return mgr.GetTypes<SurfaceController>();
}
internal static IEnumerable<Type> GetUmbracoApiControllers(this TypeLoader mgr)
{
return mgr.GetTypes<UmbracoApiController>();
}
/// <summary>
/// Gets all types implementing <see cref="UmbracoApiController"/>.
/// </summary>
internal static IEnumerable<Type> GetUmbracoApiControllers(this TypeLoader typeLoader)
=> typeLoader.GetTypes<UmbracoApiController>();
}
}