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
ExtensionModelTypeTypeThe
TExtensionModeltype this registration handles.ModelTypeTypeThe
TModeltype this registration was declared against.HandlerTypeTypeThe concrete handler implementation type, resolved via
AddInManager.LoadFunc<object, object, object>Loads the extension's current persisted value for a given model instance.
HandleAction<object, object, object, object>Invokes the handler's
Handlemethod with the command, model and extension instance.
Properties
ExtensionModelType
The TExtensionModel type this registration handles.
public Type ExtensionModelType { get; init; }
Property Value
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
HandlerType
The concrete handler implementation type, resolved via AddInManager.
public Type HandlerType { get; init; }
Property Value
Load
Loads the extension's current persisted value for a given model instance.
public Func<object, object, object> Load { get; init; }
Property Value
ModelType
The TModel type this registration was declared against.
public Type ModelType { get; init; }
Property Value
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
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
extensionModelTypeType