ModuleBase.CustomizeLogics(CustomLogics) Method

Allows you to override domain logic classes registered for Application Model interfaces.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v18.2.dll

Declaration

public virtual void CustomizeLogics(
    CustomLogics customLogics
)
Public Overridable Sub CustomizeLogics(
    customLogics As CustomLogics
)

Parameters

Type Name Description
CustomLogics customLogics

A CustomLogics object exposing methods to manage domain logic classes registered for Application Model interfaces.

Remarks

This method allows you to replace the default domain logic implementations used for the Application Model interfaces with custom ones. For this purpose, a CustomLogics object exposed by the customLogics parameter supplies the CustomLogics.RegisterLogic and CustomLogics.UnregisterLogic methods. The following code snippet illustrates their use. The IModelDetailView interface's ModelDetailViewDomainLogic is replaced by a custom MyLogic domain logic class. The custom logic class changes the default value of the IModelView.AllowEdit property for all the Detail Views to false.

using DevExpress.ExpressApp.DC;
using DevExpress.ExpressApp.DC.Xpo;
using DevExpress.ExpressApp.Model;
using DevExpress.ExpressApp.Model.DomainLogics;
//...
public sealed partial class MyModule : ModuleBase {
    //...
    public override void CustomizeLogics(CustomLogics customLogics) {
        base.CustomizeLogics(customLogics);
        customLogics.UnregisterLogic(typeof(IModelDetailView), typeof(ModelDetailViewDomainLogic));
        customLogics.RegisterLogic(typeof(IModelDetailView), typeof(MyLogic));        
    }
}
[DomainLogic(typeof(IModelDetailView))]
public static class MyLogic {
    public static bool Get_AllowEdit(IModelDetailView modelView) {
        return false;
    }
}
See Also