Skip to main content
.NET Framework 4.5.2+

ModuleBase.CustomizeLogics(CustomLogics) Method

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

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v24.1.dll

NuGet Package: DevExpress.ExpressApp

Declaration

public virtual void CustomizeLogics(
    CustomLogics customLogics
)

Parameters

Name Type 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;
    }
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CustomizeLogics(CustomLogics) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also