Gets publishing validation working with scheduled cultures, cleans up some code, removes Status from IContent into an extension method

This commit is contained in:
Shannon
2018-11-06 21:33:24 +11:00
parent 24360a762c
commit 9b1d9e02bf
10 changed files with 235 additions and 134 deletions

View File

@@ -9,7 +9,8 @@ namespace Umbraco.Core.Models
public class ContentScheduleCollection : INotifyCollectionChanged, IDeepCloneable
{
//underlying storage for the collection backed by a sorted list so that the schedule is always in order of date
private readonly Dictionary<string, SortedList<DateTime, ContentSchedule>> _schedule = new Dictionary<string, SortedList<DateTime, ContentSchedule>>();
private readonly Dictionary<string, SortedList<DateTime, ContentSchedule>> _schedule
= new Dictionary<string, SortedList<DateTime, ContentSchedule>>(StringComparer.InvariantCultureIgnoreCase);
public event NotifyCollectionChangedEventHandler CollectionChanged;
@@ -161,14 +162,12 @@ namespace Umbraco.Core.Models
return Enumerable.Empty<ContentSchedule>();
}
//fixme - should this just return IEnumerable<ContentSchedule> since the culture is part of the ContentSchedule object already?
/// <summary>
/// Returns all schedules for both invariant and variant cultures
/// </summary>
/// <returns></returns>
public IReadOnlyDictionary<string, IEnumerable<ContentSchedule>> GetFullSchedule()
{
return _schedule.ToDictionary(x => x.Key, x => (IEnumerable<ContentSchedule>)x.Value.Values);
}
public IReadOnlyDictionary<string, IEnumerable<ContentSchedule>> FullSchedule => _schedule.ToDictionary(x => x.Key, x => (IEnumerable<ContentSchedule>)x.Value.Values);
public object DeepClone()
{