Bit of cleanup

This commit is contained in:
Stephan
2019-01-18 10:02:47 +01:00
parent a7a3fca8a8
commit 437385fd61
22 changed files with 116 additions and 91 deletions

View File

@@ -2,12 +2,10 @@
using System.Linq;
using Umbraco.Core.Composing;
using Umbraco.Core.Manifest;
using Umbraco.Core.Models.ContentEditing;
using Umbraco.Web.Models.Trees;
using Umbraco.Core.Models.Trees;
namespace Umbraco.Web.Trees
{
//fixme: how can a developer re-sort the items in this collection ?
public class BackOfficeSectionCollectionBuilder : OrderedCollectionBuilderBase<BackOfficeSectionCollectionBuilder, BackOfficeSectionCollection, IBackOfficeSection>
{
protected override BackOfficeSectionCollectionBuilder This => this;
@@ -19,20 +17,7 @@ namespace Umbraco.Web.Trees
// its dependencies too, and that can create cycles or other oddities
var manifestParser = factory.GetInstance<ManifestParser>();
return base.CreateItems(factory)
.Concat(manifestParser.Manifest.Sections.Select(x => new ManifestBackOfficeSection(x.Key, x.Value)));
}
private class ManifestBackOfficeSection : IBackOfficeSection
{
public ManifestBackOfficeSection(string @alias, string name)
{
Alias = alias;
Name = name;
}
public string Alias { get; }
public string Name { get; }
return base.CreateItems(factory).Concat(manifestParser.Manifest.Sections);
}
}
}