Skip to content

Commit

Permalink
renaming methods
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeAlhayek committed Oct 24, 2024
1 parent 80ea5b7 commit 0800bc1
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down Expand Up @@ -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)))
{
Expand All @@ -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))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace OrchardCore.ContentTypes.Events;

public sealed class BuildingContentTypeContext : BuildingContentTypeContextBase
public sealed class BuildingContentTypeContext : ContentDefinitionBuildingContextBase
{
public ContentTypeDefinitionRecord Record { get; set; }

Expand Down
Original file line number Diff line number Diff line change
@@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}
}
8 changes: 4 additions & 4 deletions src/docs/releases/2.1.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ A new abstract class, `DeploymentSourceBase<TStep>`, 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

Expand Down

0 comments on commit 0800bc1

Please sign in to comment.