using System; using Umbraco.Core.Exceptions; namespace Umbraco.Core.Models.PublishedContent { /// /// Contains the culture specific data for a item /// public struct PublishedCultureName { public PublishedCultureName(string name, string urlName) : this() { Name = name ?? throw new ArgumentNullException(nameof(name)); UrlName = urlName ?? throw new ArgumentNullException(nameof(urlName)); } public string Name { get; } public string UrlName { get; } } /// /// Contains culture specific values for . /// public class PublishedCultureInfos { /// /// Initializes a new instance of the class. /// public PublishedCultureInfos(string culture, string name, bool published, DateTime publishedDate) { if (string.IsNullOrWhiteSpace(culture)) throw new ArgumentNullOrEmptyException(nameof(culture)); if (string.IsNullOrWhiteSpace(name)) throw new ArgumentNullOrEmptyException(nameof(name)); Culture = culture; Name = name; UrlSegment = name.ToUrlSegment(culture); Published = published; PublishedDate = publishedDate; } /// /// Gets the culture. /// public string Culture { get; } /// /// Gets the name of the item. /// public string Name { get; } /// /// Gets the url segment of the item. /// public string UrlSegment { get; } /// /// Gets a value indicating whether the culture is published. /// /// /// A published content item will only have published cultures, and therefore this /// value will always be true. On the other hand, fixme drafts? /// public bool Published { get; } /// /// Gets the date when fixme? /// public DateTime PublishedDate { get; } // fixme - model? model.UpdateDate - here? } }