Move sections to their own namespace
This commit is contained in:
17
src/Umbraco.Web/Sections/ContentSection.cs
Normal file
17
src/Umbraco.Web/Sections/ContentSection.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models.Sections;
|
||||
|
||||
namespace Umbraco.Web.Sections
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the back office content section
|
||||
/// </summary>
|
||||
public class ContentSection : ISection
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public string Alias => Constants.Applications.Content;
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Name => "Content";
|
||||
}
|
||||
}
|
||||
14
src/Umbraco.Web/Sections/FormsSection.cs
Normal file
14
src/Umbraco.Web/Sections/FormsSection.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models.Sections;
|
||||
|
||||
namespace Umbraco.Web.Sections
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the back office media section
|
||||
/// </summary>
|
||||
public class FormsSection : ISection
|
||||
{
|
||||
public string Alias => Constants.Applications.Forms;
|
||||
public string Name => "Forms";
|
||||
}
|
||||
}
|
||||
14
src/Umbraco.Web/Sections/MediaSection.cs
Normal file
14
src/Umbraco.Web/Sections/MediaSection.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models.Sections;
|
||||
|
||||
namespace Umbraco.Web.Sections
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the back office media section
|
||||
/// </summary>
|
||||
public class MediaSection : ISection
|
||||
{
|
||||
public string Alias => Constants.Applications.Media;
|
||||
public string Name => "Media";
|
||||
}
|
||||
}
|
||||
17
src/Umbraco.Web/Sections/MembersSection.cs
Normal file
17
src/Umbraco.Web/Sections/MembersSection.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models.Sections;
|
||||
|
||||
namespace Umbraco.Web.Sections
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the back office members section
|
||||
/// </summary>
|
||||
public class MembersSection : ISection
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public string Alias => Constants.Applications.Members;
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Name => "Members";
|
||||
}
|
||||
}
|
||||
17
src/Umbraco.Web/Sections/PackagesSection.cs
Normal file
17
src/Umbraco.Web/Sections/PackagesSection.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models.Sections;
|
||||
|
||||
namespace Umbraco.Web.Sections
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the back office packages section
|
||||
/// </summary>
|
||||
public class PackagesSection : ISection
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public string Alias => Constants.Applications.Packages;
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Name => "Packages";
|
||||
}
|
||||
}
|
||||
13
src/Umbraco.Web/Sections/SectionCollection.cs
Normal file
13
src/Umbraco.Web/Sections/SectionCollection.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Core.Composing;
|
||||
using Umbraco.Core.Models.Sections;
|
||||
|
||||
namespace Umbraco.Web.Sections
|
||||
{
|
||||
public class SectionCollection : BuilderCollectionBase<ISection>
|
||||
{
|
||||
public SectionCollection(IEnumerable<ISection> items)
|
||||
: base(items)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
24
src/Umbraco.Web/Sections/SectionCollectionBuilder.cs
Normal file
24
src/Umbraco.Web/Sections/SectionCollectionBuilder.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Composing;
|
||||
using Umbraco.Core.Manifest;
|
||||
using Umbraco.Core.Models.Sections;
|
||||
|
||||
namespace Umbraco.Web.Sections
|
||||
{
|
||||
public class SectionCollectionBuilder : OrderedCollectionBuilderBase<SectionCollectionBuilder, SectionCollection, ISection>
|
||||
{
|
||||
protected override SectionCollectionBuilder This => this;
|
||||
|
||||
protected override IEnumerable<ISection> CreateItems(IFactory factory)
|
||||
{
|
||||
// get the manifest parser just-in-time - injecting it in the ctor would mean that
|
||||
// simply getting the builder in order to configure the collection, would require
|
||||
// its dependencies too, and that can create cycles or other oddities
|
||||
var manifestParser = factory.GetInstance<ManifestParser>();
|
||||
|
||||
return base.CreateItems(factory).Concat(manifestParser.Manifest.Sections);
|
||||
}
|
||||
}
|
||||
}
|
||||
17
src/Umbraco.Web/Sections/SettingsSection.cs
Normal file
17
src/Umbraco.Web/Sections/SettingsSection.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models.Sections;
|
||||
|
||||
namespace Umbraco.Web.Sections
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the back office settings section
|
||||
/// </summary>
|
||||
public class SettingsSection : ISection
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public string Alias => Constants.Applications.Settings;
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Name => "Settings";
|
||||
}
|
||||
}
|
||||
17
src/Umbraco.Web/Sections/TranslationSection.cs
Normal file
17
src/Umbraco.Web/Sections/TranslationSection.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models.Sections;
|
||||
|
||||
namespace Umbraco.Web.Sections
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the back office translation section
|
||||
/// </summary>
|
||||
public class TranslationSection : ISection
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public string Alias => Constants.Applications.Translation;
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Name => "Translation";
|
||||
}
|
||||
}
|
||||
17
src/Umbraco.Web/Sections/UsersSection.cs
Normal file
17
src/Umbraco.Web/Sections/UsersSection.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models.Sections;
|
||||
|
||||
namespace Umbraco.Web.Sections
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the back office users section
|
||||
/// </summary>
|
||||
public class UsersSection : ISection
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public string Alias => Constants.Applications.Users;
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Name => "Users";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user