Files
Umbraco-CMS/src/Umbraco.Web/Trees/TreeController.cs
2017-09-12 16:22:16 +02:00

41 lines
1010 B
C#

using System;
using System.Linq;
using Umbraco.Core.Services;
namespace Umbraco.Web.Trees
{
/// <summary>
/// The base controller for all tree requests
/// </summary>
public abstract class TreeController : TreeControllerBase
{
private TreeAttribute _attribute;
protected TreeController()
{
Initialize();
}
/// <summary>
/// The name to display on the root node
/// </summary>
public override string RootNodeDisplayName
{
get { return _attribute.GetRootNodeDisplayName(Services.TextService); }
}
/// <summary>
/// Gets the current tree alias from the attribute assigned to it.
/// </summary>
public override string TreeAlias
{
get { return _attribute.Alias; }
}
private void Initialize()
{
_attribute = GetType().GetTreeAttribute();
}
}
}