2021-09-07 12:10:58 +02:00
|
|
|
using System;
|
2021-06-15 13:22:19 +02:00
|
|
|
using System.Collections.Generic;
|
2015-10-06 17:19:08 +02:00
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
using System.Runtime.Serialization;
|
|
|
|
|
|
2021-02-18 11:06:02 +01:00
|
|
|
namespace Umbraco.Cms.Core.Models.ContentEditing
|
2015-10-06 17:19:08 +02:00
|
|
|
{
|
2016-01-21 15:06:57 +01:00
|
|
|
[DataContract(Name = "propertyGroup", Namespace = "")]
|
2016-01-21 15:01:55 +01:00
|
|
|
public abstract class PropertyGroupBasic
|
2015-10-06 17:19:08 +02:00
|
|
|
{
|
2015-11-17 12:30:37 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the special generic properties tab identifier.
|
|
|
|
|
/// </summary>
|
2015-11-03 17:54:51 +01:00
|
|
|
public const int GenericPropertiesGroupId = -666;
|
|
|
|
|
|
2015-11-17 12:30:37 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// Gets a value indicating whether this tab is the generic properties tab.
|
|
|
|
|
/// </summary>
|
2015-11-03 17:54:51 +01:00
|
|
|
[IgnoreDataMember]
|
2017-11-15 08:53:20 +01:00
|
|
|
public bool IsGenericProperties => Id == GenericPropertiesGroupId;
|
2015-11-03 17:54:51 +01:00
|
|
|
|
2015-11-17 12:30:37 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// Gets a value indicating whether the property group is inherited through
|
|
|
|
|
/// content types composition.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>A property group can be inherited and defined on the content type
|
|
|
|
|
/// currently being edited, at the same time. Inherited is true when there exists at least
|
|
|
|
|
/// one property group higher in the composition, with the same alias.</remarks>
|
2015-10-06 17:19:08 +02:00
|
|
|
[DataMember(Name = "inherited")]
|
|
|
|
|
public bool Inherited { get; set; }
|
|
|
|
|
|
2015-11-17 12:30:37 +01:00
|
|
|
// needed - so we can handle alias renames
|
2015-10-06 17:19:08 +02:00
|
|
|
[DataMember(Name = "id")]
|
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
|
2021-06-15 13:22:19 +02:00
|
|
|
[DataMember(Name = "key")]
|
|
|
|
|
public Guid Key { get; set; }
|
|
|
|
|
|
2021-06-22 11:45:23 +02:00
|
|
|
[DataMember(Name = "type")]
|
|
|
|
|
public PropertyGroupType Type { get; set; }
|
2015-10-06 17:19:08 +02:00
|
|
|
|
|
|
|
|
[Required]
|
|
|
|
|
[DataMember(Name = "name")]
|
|
|
|
|
public string Name { get; set; }
|
2021-06-15 13:22:19 +02:00
|
|
|
|
2021-07-13 14:49:57 +02:00
|
|
|
[Required]
|
|
|
|
|
[DataMember(Name = "alias")]
|
|
|
|
|
public string Alias { get; set; }
|
|
|
|
|
|
2021-06-15 13:22:19 +02:00
|
|
|
[DataMember(Name = "sortOrder")]
|
|
|
|
|
public int SortOrder { get; set; }
|
2015-10-06 17:19:08 +02:00
|
|
|
}
|
2016-01-21 15:01:55 +01:00
|
|
|
|
|
|
|
|
[DataContract(Name = "propertyGroup", Namespace = "")]
|
|
|
|
|
public class PropertyGroupBasic<TPropertyType> : PropertyGroupBasic
|
|
|
|
|
where TPropertyType: PropertyTypeBasic
|
|
|
|
|
{
|
|
|
|
|
public PropertyGroupBasic()
|
|
|
|
|
{
|
|
|
|
|
Properties = new List<TPropertyType>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[DataMember(Name = "properties")]
|
|
|
|
|
public IEnumerable<TPropertyType> Properties { get; set; }
|
|
|
|
|
}
|
2017-07-20 11:21:28 +02:00
|
|
|
}
|