Move IsCultureAvailable to IContentBase
This commit is contained in:
@@ -253,10 +253,6 @@ namespace Umbraco.Core.Models
|
||||
PublishName = null;
|
||||
_publishNames = null;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool IsCultureAvailable(string culture)
|
||||
=> !string.IsNullOrWhiteSpace(GetName(culture));
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool IsCulturePublished(string culture)
|
||||
|
||||
@@ -121,6 +121,22 @@ namespace Umbraco.Core.Models
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the enumeration of property groups for the entity.
|
||||
/// fixme is a proxy, kill this
|
||||
/// </summary>
|
||||
[IgnoreDataMember]
|
||||
public IEnumerable<PropertyGroup> PropertyGroups => ContentTypeBase.CompositionPropertyGroups;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the numeration of property types for the entity.
|
||||
/// fixme is a proxy, kill this
|
||||
/// </summary>
|
||||
[IgnoreDataMember]
|
||||
public IEnumerable<PropertyType> PropertyTypes => ContentTypeBase.CompositionPropertyTypes;
|
||||
|
||||
#region Cultures
|
||||
|
||||
/// <inheritdoc />
|
||||
[DataMember]
|
||||
public virtual IReadOnlyDictionary<string, string> Names
|
||||
@@ -140,7 +156,7 @@ namespace Umbraco.Core.Models
|
||||
{
|
||||
ClearName(culture);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (culture == null)
|
||||
{
|
||||
@@ -158,6 +174,18 @@ namespace Umbraco.Core.Models
|
||||
OnPropertyChanged(Ps.Value.NamesSelector);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual string GetName(string culture)
|
||||
{
|
||||
if (culture == null) return Name;
|
||||
if (_names == null) return null;
|
||||
return _names.TryGetValue(culture, out var name) ? name : null;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool IsCultureAvailable(string culture)
|
||||
=> !string.IsNullOrWhiteSpace(GetName(culture));
|
||||
|
||||
private void ClearName(string culture)
|
||||
{
|
||||
if (culture == null)
|
||||
@@ -177,28 +205,8 @@ namespace Umbraco.Core.Models
|
||||
_names = null;
|
||||
OnPropertyChanged(Ps.Value.NamesSelector);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual string GetName(string culture)
|
||||
{
|
||||
if (culture == null) return Name;
|
||||
if (_names == null) return null;
|
||||
return _names.TryGetValue(culture, out var name) ? name : null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the enumeration of property groups for the entity.
|
||||
/// fixme is a proxy, kill this
|
||||
/// </summary>
|
||||
[IgnoreDataMember]
|
||||
public IEnumerable<PropertyGroup> PropertyGroups => ContentTypeBase.CompositionPropertyGroups;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the numeration of property types for the entity.
|
||||
/// fixme is a proxy, kill this
|
||||
/// </summary>
|
||||
[IgnoreDataMember]
|
||||
public IEnumerable<PropertyType> PropertyTypes => ContentTypeBase.CompositionPropertyTypes;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Has, Get, Set, Publish Property Value
|
||||
|
||||
|
||||
@@ -80,15 +80,6 @@ namespace Umbraco.Core.Models
|
||||
/// </summary>
|
||||
ContentStatus Status { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether a given culture is available.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>A culture becomes available whenever the content name for this culture is
|
||||
/// non-null, and it becomes unavailable whenever the content name is null.</para>
|
||||
/// </remarks>
|
||||
bool IsCultureAvailable(string culture);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether a given culture is published.
|
||||
/// </summary>
|
||||
|
||||
@@ -51,9 +51,18 @@ namespace Umbraco.Core.Models
|
||||
/// <remarks>
|
||||
/// <para>Because a dictionary key cannot be <c>null</c> this cannot get nor set the invariant
|
||||
/// name, which must be get or set via the <see cref="TreeEntityBase.Name"/> property.</para>
|
||||
/// </remarks>
|
||||
/// </remarks>
|
||||
IReadOnlyDictionary<string, string> Names { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether a given culture is available.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>A culture becomes available whenever the content name for this culture is
|
||||
/// non-null, and it becomes unavailable whenever the content name is null.</para>
|
||||
/// </remarks>
|
||||
bool IsCultureAvailable(string culture);
|
||||
|
||||
/// <summary>
|
||||
/// List of properties, which make up all the data available for this Content object
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user