using System.Collections.Generic; using System.ComponentModel; using System.Runtime.Serialization; using Umbraco.Core.Models; namespace Umbraco.Web.Models.ContentEditing { public abstract class ContentItemDisplayBase : TabbedContentItem, INotificationModel, IErrorModel where T : ContentPropertyBasic { protected ContentItemDisplayBase() { Notifications = new List(); Errors = new Dictionary(); } /// /// The name of the content type /// [DataMember(Name = "contentTypeName")] public string ContentTypeName { get; set; } /// /// Indicates if the content is configured as a list view container /// [DataMember(Name = "isContainer")] public bool IsContainer { get; set; } /// /// This is used to add custom localized messages/strings to the response for the app to use for localized UI purposes. /// [DataMember(Name = "notifications")] [ReadOnly(true)] public List Notifications { get; private set; } /// /// This is used for validation of a content item. /// /// /// A content item can be invalid but still be saved. This occurs when there's property validation errors, we will /// still save the item but it cannot be published. So we need a way of returning validation errors as well as the /// updated model. /// /// NOTE: The ProperCase is important because when we return ModeState normally it will always be proper case. /// [DataMember(Name = "ModelState")] [ReadOnly(true)] public IDictionary Errors { get; set; } } }