Port 7.7 - WIP

This commit is contained in:
Stephan
2017-09-08 19:39:13 +02:00
parent 00d2ea928d
commit 1c96df83cd
99 changed files with 9987 additions and 909 deletions

View File

@@ -0,0 +1,36 @@
using System;
using Umbraco.Core.Exceptions;
namespace Umbraco.Web.Search
{
[AttributeUsage(AttributeTargets.Class)]
public sealed class SearchableTreeAttribute : Attribute
{
/// <summary>
/// This constructor defines both the angular service and method name to use
/// </summary>
/// <param name="serviceName"></param>
/// <param name="methodName"></param>
public SearchableTreeAttribute(string serviceName, string methodName)
{
if (string.IsNullOrWhiteSpace(serviceName)) throw new ArgumentNullOrEmptyException(nameof(serviceName));
if (string.IsNullOrWhiteSpace(methodName)) throw new ArgumentNullOrEmptyException(nameof(methodName));
MethodName = methodName;
ServiceName = serviceName;
}
/// <summary>
/// This constructor will assume that the method name equals `format(searchResult, appAlias, treeAlias)`
/// </summary>
/// <param name="serviceName"></param>
public SearchableTreeAttribute(string serviceName)
{
if (string.IsNullOrWhiteSpace(serviceName)) throw new ArgumentNullOrEmptyException(nameof(serviceName));
MethodName = "";
ServiceName = serviceName;
}
public string MethodName { get; }
public string ServiceName { get; }
}
}