2018-07-13 12:45:04 +10:00
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Runtime.Serialization;
|
2018-08-08 16:29:07 +10:00
|
|
|
|
using Newtonsoft.Json.Converters;
|
2018-07-13 12:45:04 +10:00
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Web.Models.ContentEditing
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Represents the variant info for a content item
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[DataContract(Name = "contentVariant", Namespace = "")]
|
2018-08-16 23:30:33 +10:00
|
|
|
|
public class ContentVariantDisplay : ITabbedContent<ContentPropertyDisplay>, IContentProperties<ContentPropertyDisplay>
|
2018-07-13 12:45:04 +10:00
|
|
|
|
{
|
|
|
|
|
|
public ContentVariantDisplay()
|
|
|
|
|
|
{
|
|
|
|
|
|
Tabs = new List<Tab<ContentPropertyDisplay>>();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[DataMember(Name = "name", IsRequired = true)]
|
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Defines the tabs containing display properties
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[DataMember(Name = "tabs")]
|
|
|
|
|
|
public IEnumerable<Tab<ContentPropertyDisplay>> Tabs { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2018-08-16 23:30:33 +10:00
|
|
|
|
/// Internal property used for tests to get all properties from all tabs
|
2018-07-13 12:45:04 +10:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
[IgnoreDataMember]
|
2018-08-16 23:30:33 +10:00
|
|
|
|
[JsonIgnore]
|
|
|
|
|
|
IEnumerable<ContentPropertyDisplay> IContentProperties<ContentPropertyDisplay>.Properties => Tabs.SelectMany(x => x.Properties);
|
2018-07-13 12:45:04 +10:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The language/culture assigned to this content variation
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <remarks>
|
|
|
|
|
|
/// If this is null it means this content variant is an invariant culture
|
|
|
|
|
|
/// </remarks>
|
|
|
|
|
|
[DataMember(Name = "language")]
|
|
|
|
|
|
public Language Language { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[DataMember(Name = "segment")]
|
|
|
|
|
|
public string Segment { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[DataMember(Name = "state")]
|
2018-08-08 16:29:07 +10:00
|
|
|
|
[JsonConverter(typeof(StringEnumConverter))]
|
|
|
|
|
|
public ContentSavedState State { get; set; }
|
2018-07-13 12:45:04 +10:00
|
|
|
|
|
|
|
|
|
|
[DataMember(Name = "updateDate")]
|
|
|
|
|
|
public DateTime UpdateDate { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[DataMember(Name = "createDate")]
|
|
|
|
|
|
public DateTime CreateDate { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[DataMember(Name = "publishDate")]
|
|
|
|
|
|
public DateTime? PublishDate { get; set; }
|
2018-08-15 15:13:27 +10:00
|
|
|
|
|
2018-07-13 12:45:04 +10:00
|
|
|
|
}
|
|
|
|
|
|
}
|