Moved more abstractions of models

This commit is contained in:
Bjarke Berg
2019-05-27 11:20:33 +02:00
parent e571f51750
commit 408b00a737
19 changed files with 9 additions and 27 deletions

View File

@@ -1,72 +0,0 @@
using System.Runtime.Serialization;
namespace Umbraco.Core.Models.ContentEditing
{
/// <summary>
/// Represents a content app.
/// </summary>
/// <remarks>
/// <para>Content apps are editor extensions.</para>
/// </remarks>
[DataContract(Name = "app", Namespace = "")]
public class ContentApp
{
/// <summary>
/// Gets the name of the content app.
/// </summary>
[DataMember(Name = "name")]
public string Name { get; set; }
/// <summary>
/// Gets the unique alias of the content app.
/// </summary>
/// <remarks>
/// <para>Must be a valid javascript identifier, ie no spaces etc.</para>
/// </remarks>
[DataMember(Name = "alias")]
public string Alias { get; set; }
/// <summary>
/// Gets or sets the weight of the content app.
/// </summary>
/// <remarks>
/// <para>Content apps are ordered by weight, from left (lowest values) to right (highest values).</para>
/// <para>Some built-in apps have special weights: listview is -666, content is -100 and infos is +100.</para>
/// <para>The default weight is 0, meaning somewhere in-between content and infos, but weight could
/// be used for ordering between user-level apps, or anything really.</para>
/// </remarks>
[DataMember(Name = "weight")]
public int Weight { get; set; }
/// <summary>
/// Gets the icon of the content app.
/// </summary>
/// <remarks>
/// <para>Must be a valid helveticons class name (see http://hlvticons.ch/).</para>
/// </remarks>
[DataMember(Name = "icon")]
public string Icon { get; set; }
/// <summary>
/// Gets the view for rendering the content app.
/// </summary>
[DataMember(Name = "view")]
public string View { get; set; }
/// <summary>
/// The view model specific to this app
/// </summary>
[DataMember(Name = "viewModel")]
public object ViewModel { get; set; }
/// <summary>
/// Gets a value indicating whether the app is active.
/// </summary>
/// <remarks>
/// <para>Normally reserved for Angular to deal with but in some cases this can be set on the server side.</para>
/// </remarks>
[DataMember(Name = "active")]
public bool Active { get; set; }
}
}

View File

@@ -1,23 +0,0 @@
using System.Collections.Generic;
using Umbraco.Core.Models.Membership;
namespace Umbraco.Core.Models.ContentEditing
{
/// <summary>
/// Represents a content app factory.
/// </summary>
public interface IContentAppFactory
{
/// <summary>
/// Gets the content app for an object.
/// </summary>
/// <param name="source">The source object.</param>
/// <returns>The content app for the object, or null.</returns>
/// <remarks>
/// <para>The definition must determine, based on <paramref name="source"/>, whether
/// the content app should be displayed or not, and return either a <see cref="ContentApp"/>
/// instance, or null.</para>
/// </remarks>
ContentApp GetContentAppFor(object source, IEnumerable<IReadOnlyUserGroup> userGroups);
}
}