Table of Contents

Class ModelExtensionHandlerRegistration

Namespace
Dynamicweb.CoreUI.Data
Assembly
Dynamicweb.CoreUI.dll

One extension registered against a model type: the extension model it carries, and a way to invoke its handler generically without the caller knowing the closed generic types involved.

public sealed record ModelExtensionHandlerRegistration : IEquatable<ModelExtensionHandlerRegistration>
Inheritance
ModelExtensionHandlerRegistration
Implements
Inherited Members

Constructors

ModelExtensionHandlerRegistration(Type, Type, Type, Func<object, object, object>, Action<object, object, object, object>)

One extension registered against a model type: the extension model it carries, and a way to invoke its handler generically without the caller knowing the closed generic types involved.

public ModelExtensionHandlerRegistration(Type ExtensionModelType, Type ModelType, Type HandlerType, Func<object, object, object> Load, Action<object, object, object, object> Handle)

Parameters

ExtensionModelType Type

The TExtensionModel type this registration handles.

ModelType Type

The TModel type this registration was declared against.

HandlerType Type

The concrete handler implementation type, resolved via AddInManager.

Load Func<object, object, object>

Loads the extension's current persisted value for a given model instance.

Handle Action<object, object, object, object>

Invokes the handler's Handle method with the command, model and extension instance.

Properties

ExtensionModelType

The TExtensionModel type this registration handles.

public Type ExtensionModelType { get; init; }

Property Value

Type

Handle

Invokes the handler's Handle method with the command, model and extension instance.

public Action<object, object, object, object> Handle { get; init; }

Property Value

Action<object, object, object, object>

HandlerType

The concrete handler implementation type, resolved via AddInManager.

public Type HandlerType { get; init; }

Property Value

Type

Load

Loads the extension's current persisted value for a given model instance.

public Func<object, object, object> Load { get; init; }

Property Value

Func<object, object, object>

ModelType

The TModel type this registration was declared against.

public Type ModelType { get; init; }

Property Value

Type

WireKeyPrefix

The prefix this extension's editor names and posted field keys are namespaced under on the wire, so two extensions targeting the same model can't collide even when they reuse the same property names.

public string WireKeyPrefix { get; }

Property Value

string

Remarks

Derived from ExtensionModelType's bare type name, not its fully-qualified name - unique among the extensions registered for one model is all that's required, since a prefix is only ever compared against others already scoped to that same model (see GetRegistrations(Type)), never across the whole application.

Methods

ComputeWireKeyPrefix(Type)

Computes the same prefix as WireKeyPrefix directly from a TExtensionModel type, for callers - like EditScreenModelExtensionInjector<TScreen, TModel, TExtensionModel> - that only know the extension model's type at compile time and never resolve an actual registration.

public static string ComputeWireKeyPrefix(Type extensionModelType)

Parameters

extensionModelType Type

Returns

string
To top