From 0800bc160bab2605ff11193d847c9930cd3ecd93 Mon Sep 17 00:00:00 2001 From: Mike Alhayek Date: Thu, 24 Oct 2024 11:32:40 -0700 Subject: [PATCH] renaming methods --- .../DashboardPartContentTypeDefinitionHandler.cs | 6 +++--- .../ContentDefinitionManager.cs | 14 +++++++------- .../Events/BuildingContentTypeContext.cs | 2 +- ....cs => ContentDefinitionBuildingContextBase.cs} | 4 ++-- .../Events/ContentDefinitionHandlerBase.cs | 8 ++++---- ....cs => ContentPartDefinitionContextBuilding.cs} | 4 ++-- ...ntext.cs => ContentPartFieldContextBuilding.cs} | 4 ++-- ...ontext.cs => ContentTypePartContextBuilding.cs} | 4 ++-- .../Events/IContentDefinitionEventHandler.cs | 8 ++++---- src/docs/releases/2.1.0.md | 8 ++++---- 10 files changed, 31 insertions(+), 31 deletions(-) rename src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/{BuildingContentTypeContextBase.cs => ContentDefinitionBuildingContextBase.cs} (58%) rename src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/{BuildingContentPartDefinitionContext.cs => ContentPartDefinitionContextBuilding.cs} (61%) rename src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/{BuildingContentPartFieldContext.cs => ContentPartFieldContextBuilding.cs} (62%) rename src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/{BuildingContentTypePartContext.cs => ContentTypePartContextBuilding.cs} (62%) diff --git a/src/OrchardCore.Modules/OrchardCore.AdminDashboard/Services/DashboardPartContentTypeDefinitionHandler.cs b/src/OrchardCore.Modules/OrchardCore.AdminDashboard/Services/DashboardPartContentTypeDefinitionHandler.cs index 1db184d4b73..e95d9f77b56 100644 --- a/src/OrchardCore.Modules/OrchardCore.AdminDashboard/Services/DashboardPartContentTypeDefinitionHandler.cs +++ b/src/OrchardCore.Modules/OrchardCore.AdminDashboard/Services/DashboardPartContentTypeDefinitionHandler.cs @@ -9,7 +9,7 @@ namespace OrchardCore.AdminDashboard.Services; public sealed class DashboardPartContentTypeDefinitionHandler : ContentDefinitionHandlerBase { - public override void BuildingContentType(BuildingContentTypeContext context) + public override void ContentTypeBuilding(BuildingContentTypeContext context) { if (!context.Record.Settings.TryGetPropertyValue(nameof(ContentTypeSettings), out var node)) { @@ -42,7 +42,7 @@ public override void BuildingContentType(BuildingContentTypeContext context) }); } - public override void BuildingContentTypePart(BuildingContentTypePartContext context) + public override void ContentTypePartBuilding(ContentTypePartContextBuilding context) { if (!context.Record.PartName.EqualsOrdinalIgnoreCase(nameof(DashboardPart))) { @@ -57,7 +57,7 @@ public override void BuildingContentTypePart(BuildingContentTypePartContext cont context.Record.Settings[nameof(ContentSettings)] = JObject.FromObject(settings); } - public override void BuildingContentPartDefinition(BuildingContentPartDefinitionContext context) + public override void ContentPartDefinitionBuilding(ContentPartDefinitionContextBuilding context) { if (context.Record is not null || context.Name != nameof(DashboardPart)) { diff --git a/src/OrchardCore/OrchardCore.ContentManagement/ContentDefinitionManager.cs b/src/OrchardCore/OrchardCore.ContentManagement/ContentDefinitionManager.cs index 980afd81dc2..99be7bfebee 100644 --- a/src/OrchardCore/OrchardCore.ContentManagement/ContentDefinitionManager.cs +++ b/src/OrchardCore/OrchardCore.ContentManagement/ContentDefinitionManager.cs @@ -341,7 +341,7 @@ private ContentTypeDefinition Build( { var context = new BuildingContentTypeContext(name, source); - _handlers.Invoke((handler, ctx) => handler.BuildingContentType(ctx), context, _logger); + _handlers.Invoke((handler, ctx) => handler.ContentTypeBuilding(ctx), context, _logger); if (context.Record is null) { @@ -362,9 +362,9 @@ private ContentTypePartDefinition Build( ContentTypePartDefinitionRecord source, ContentPartDefinitionRecord partDefinitionRecord) { - var context = new BuildingContentTypePartContext(name, source); + var context = new ContentTypePartContextBuilding(name, source); - _handlers.Invoke((handler, ctx) => handler.BuildingContentTypePart(ctx), context, _logger); + _handlers.Invoke((handler, ctx) => handler.ContentTypePartBuilding(ctx), context, _logger); if (context.Record is null) { @@ -379,9 +379,9 @@ private ContentTypePartDefinition Build( private ContentPartDefinition Build(string name, ContentPartDefinitionRecord source) { - var context = new BuildingContentPartDefinitionContext(name, source); + var context = new ContentPartDefinitionContextBuilding(name, source); - _handlers.Invoke((handler, ctx) => handler.BuildingContentPartDefinition(ctx), context, _logger); + _handlers.Invoke((handler, ctx) => handler.ContentPartDefinitionBuilding(ctx), context, _logger); if (context.Record is null) { @@ -396,9 +396,9 @@ private ContentPartDefinition Build(string name, ContentPartDefinitionRecord sou private ContentPartFieldDefinition Build(string name, ContentPartFieldDefinitionRecord source) { - var context = new BuildingContentPartFieldContext(name, source); + var context = new ContentPartFieldContextBuilding(name, source); - _handlers.Invoke((handler, ctx) => handler.BuildingContentPartField(ctx), context, _logger); + _handlers.Invoke((handler, ctx) => handler.ContentPartFieldBuilding(ctx), context, _logger); if (context.Record is null) { diff --git a/src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/BuildingContentTypeContext.cs b/src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/BuildingContentTypeContext.cs index 29210bf3bee..abc416b48b5 100644 --- a/src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/BuildingContentTypeContext.cs +++ b/src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/BuildingContentTypeContext.cs @@ -2,7 +2,7 @@ namespace OrchardCore.ContentTypes.Events; -public sealed class BuildingContentTypeContext : BuildingContentTypeContextBase +public sealed class BuildingContentTypeContext : ContentDefinitionBuildingContextBase { public ContentTypeDefinitionRecord Record { get; set; } diff --git a/src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/BuildingContentTypeContextBase.cs b/src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/ContentDefinitionBuildingContextBase.cs similarity index 58% rename from src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/BuildingContentTypeContextBase.cs rename to src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/ContentDefinitionBuildingContextBase.cs index 57cade2d17f..a53338abadd 100644 --- a/src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/BuildingContentTypeContextBase.cs +++ b/src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/ContentDefinitionBuildingContextBase.cs @@ -1,10 +1,10 @@ namespace OrchardCore.ContentTypes.Events; -public abstract class BuildingContentTypeContextBase +public abstract class ContentDefinitionBuildingContextBase { public readonly string Name; - protected BuildingContentTypeContextBase(string name) + protected ContentDefinitionBuildingContextBase(string name) { ArgumentException.ThrowIfNullOrEmpty(name); diff --git a/src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/ContentDefinitionHandlerBase.cs b/src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/ContentDefinitionHandlerBase.cs index 46af7ce3a11..7fc69078153 100644 --- a/src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/ContentDefinitionHandlerBase.cs +++ b/src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/ContentDefinitionHandlerBase.cs @@ -2,19 +2,19 @@ namespace OrchardCore.ContentTypes.Events; public abstract class ContentDefinitionHandlerBase : IContentDefinitionEventHandler { - public virtual void BuildingContentPartDefinition(BuildingContentPartDefinitionContext context) + public virtual void ContentPartDefinitionBuilding(ContentPartDefinitionContextBuilding context) { } - public virtual void BuildingContentPartField(BuildingContentPartFieldContext context) + public virtual void ContentPartFieldBuilding(ContentPartFieldContextBuilding context) { } - public virtual void BuildingContentType(BuildingContentTypeContext context) + public virtual void ContentTypeBuilding(BuildingContentTypeContext context) { } - public virtual void BuildingContentTypePart(BuildingContentTypePartContext context) + public virtual void ContentTypePartBuilding(ContentTypePartContextBuilding context) { } diff --git a/src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/BuildingContentPartDefinitionContext.cs b/src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/ContentPartDefinitionContextBuilding.cs similarity index 61% rename from src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/BuildingContentPartDefinitionContext.cs rename to src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/ContentPartDefinitionContextBuilding.cs index bdd0fef5ee6..21d53fc32b8 100644 --- a/src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/BuildingContentPartDefinitionContext.cs +++ b/src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/ContentPartDefinitionContextBuilding.cs @@ -2,11 +2,11 @@ namespace OrchardCore.ContentTypes.Events; -public sealed class BuildingContentPartDefinitionContext : BuildingContentTypeContextBase +public sealed class ContentPartDefinitionContextBuilding : ContentDefinitionBuildingContextBase { public ContentPartDefinitionRecord Record { get; set; } - public BuildingContentPartDefinitionContext(string name, ContentPartDefinitionRecord record) + public ContentPartDefinitionContextBuilding(string name, ContentPartDefinitionRecord record) : base(name) { Record = record; diff --git a/src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/BuildingContentPartFieldContext.cs b/src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/ContentPartFieldContextBuilding.cs similarity index 62% rename from src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/BuildingContentPartFieldContext.cs rename to src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/ContentPartFieldContextBuilding.cs index ff97ea7af82..1d6fbcf2d56 100644 --- a/src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/BuildingContentPartFieldContext.cs +++ b/src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/ContentPartFieldContextBuilding.cs @@ -2,11 +2,11 @@ namespace OrchardCore.ContentTypes.Events; -public sealed class BuildingContentPartFieldContext : BuildingContentTypeContextBase +public sealed class ContentPartFieldContextBuilding : ContentDefinitionBuildingContextBase { public ContentPartFieldDefinitionRecord Record { get; set; } - public BuildingContentPartFieldContext(string name, ContentPartFieldDefinitionRecord record) + public ContentPartFieldContextBuilding(string name, ContentPartFieldDefinitionRecord record) : base(name) { Record = record; diff --git a/src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/BuildingContentTypePartContext.cs b/src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/ContentTypePartContextBuilding.cs similarity index 62% rename from src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/BuildingContentTypePartContext.cs rename to src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/ContentTypePartContextBuilding.cs index 97a81bd7268..398df2fbcca 100644 --- a/src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/BuildingContentTypePartContext.cs +++ b/src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/ContentTypePartContextBuilding.cs @@ -2,11 +2,11 @@ namespace OrchardCore.ContentTypes.Events; -public sealed class BuildingContentTypePartContext : BuildingContentTypeContextBase +public sealed class ContentTypePartContextBuilding : ContentDefinitionBuildingContextBase { public ContentTypePartDefinitionRecord Record { get; set; } - public BuildingContentTypePartContext(string name, ContentTypePartDefinitionRecord record) + public ContentTypePartContextBuilding(string name, ContentTypePartDefinitionRecord record) : base(name) { Record = record; diff --git a/src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/IContentDefinitionEventHandler.cs b/src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/IContentDefinitionEventHandler.cs index 416cf44c4cf..31257581d89 100644 --- a/src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/IContentDefinitionEventHandler.cs +++ b/src/OrchardCore/OrchardCore.ContentTypes.Abstractions/Events/IContentDefinitionEventHandler.cs @@ -36,19 +36,19 @@ public interface IContentDefinitionEventHandler void ContentPartFieldUpdated(ContentPartFieldUpdatedContext context); - void BuildingContentType(BuildingContentTypeContext context) + void ContentTypeBuilding(BuildingContentTypeContext context) { } - void BuildingContentTypePart(BuildingContentTypePartContext context) + void ContentTypePartBuilding(ContentTypePartContextBuilding context) { } - void BuildingContentPartField(BuildingContentPartFieldContext context) + void ContentPartFieldBuilding(ContentPartFieldContextBuilding context) { } - void BuildingContentPartDefinition(BuildingContentPartDefinitionContext context) + void ContentPartDefinitionBuilding(ContentPartDefinitionContextBuilding context) { } } diff --git a/src/docs/releases/2.1.0.md b/src/docs/releases/2.1.0.md index 980f2169335..7731f74dd0c 100644 --- a/src/docs/releases/2.1.0.md +++ b/src/docs/releases/2.1.0.md @@ -170,10 +170,10 @@ A new abstract class, `DeploymentSourceBase`, has been introduced to stre We have introduced new events to the `IContentDefinitionEventHandler` interface, enabling you to hook into the content definition building process before these definitions are cached. These events provide more granular control over content type definitions during their construction. -- `BuildingContentType(BuildingContentTypeContext context)` -- `BuildingContentTypePart(BuildingContentTypePartContext context)` -- `BuildingContentPartField(BuildingContentPartFieldContext context)` -- `BuildingContentPartDefinition(BuildingContentPartDefinitionContext context)` +- `ContentTypeBuilding(BuildingContentTypeContext context)` +- `ContentTypePartBuilding(ContentTypePartContextBuilding context)` +- `ContentPartFieldBuilding(ContentPartFieldContextBuilding context)` +- `ContentPartDefinitionBuilding(ContentPartDefinitionContextBuilding context)` #### Code-Managed Content Parts