[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Collapse]eXpressApp Framework
 [Expand]Fundamentals
 [Expand]Getting Started
 [Expand]Concepts
 [Expand]Design-Time Features
 [Expand]Deployment
 [Expand]Task-Based Help
  Frequently Asked Questions (FAQ)
 [Collapse]API Reference
  [Expand]DevExpress.EasyTest.Framework
  [Collapse]DevExpress.ExpressApp
   [Expand]BaseObjectSpace Class
    CheckCompatibilityType Enumeration
   [Expand]CollectionSource Class
   [Expand]CollectionSourceBase Class
    CollectionSourceDataAccessMode Enumeration
    CollectionSourceMode Enumeration
   [Expand]CollectionSourceModeAttribute Class
   [Expand]CompositeView Class
    ConfirmationResult Enumeration
    ConfirmationType Enumeration
   [Expand]Controller Class
   [Expand]CreateCustomCollectionSourceEventArgs Class
   [Expand]CreateCustomCurrentObjectDetailViewEventArgs Class
   [Expand]CreateCustomLogonParameterStoreEventArgs Class
   [Expand]CreateCustomLogonWindowControllersEventArgs Class
   [Expand]CreateCustomLogonWindowObjectSpaceEventArgs Class
   [Expand]CreateCustomModelCacheManagerEventArgs Class
   [Expand]CreateCustomModelDifferenceStoreEventArgs Class
   [Expand]CreateCustomObjectSpaceProviderEventArgs Class
   [Expand]CreateCustomPropertyCollectionSourceEventArgs Class
   [Expand]CreateCustomTemplateEventArgs Class
   [Expand]CustomCheckCompatibilityEventArgs Class
   [Expand]CustomHasPermissionToEventArgs Class
   [Expand]CustomizeFormattingCultureEventArgs Class
   [Expand]CustomizeLanguageEventArgs Class
   [Expand]CustomizeTemplateEventArgs Class
   [Expand]CustomizeViewShortcutArgs Class
   [Expand]CustomProcessShortcutEventArgs Class
   [Expand]DashboardView Class
   [Expand]DashboardViewCreatedEventArgs Class
   [Expand]DashboardViewCreatingEventArgs Class
    DatabaseUpdateMode Enumeration
   [Expand]DatabaseVersionMismatchEventArgs Class
   [Expand]DefaultListViewOptionsAttribute Class
   [Expand]DetailView Class
   [Expand]DetailViewCreatedEventArgs Class
   [Expand]DetailViewCreatingEventArgs Class
   [Expand]Frame Class
    FrameContext Enumeration
   [Expand]IModelDifference Interface
   [Expand]IModelDifferenceAspect Interface
   [Expand]IModelExtender Interface
    InformationPosition Enumeration
    InformationType Enumeration
   [Expand]IObjectSpace Interface
   [Expand]IObjectSpaceLink Interface
   [Expand]IObjectSpaceProvider Interface
   [Expand]ISettingsProvider Interface
   [Expand]ISupportNewItemRowPosition Interface
   [Expand]ISupportUpdate Interface
   [Expand]IXafEntityObject Interface
   [Expand]LastLogonParametersReadEventArgs Class
   [Expand]LastLogonParametersReadingEventArgs Class
   [Expand]LastLogonParametersWritingEventArgs Class
   [Expand]ListView Class
   [Expand]ListViewCreatedEventArgs Class
   [Expand]ListViewCreatingEventArgs Class
   [Expand]ListViewFindPanelAttribute Class
   [Expand]LoggingOffEventArgs Class
   [Expand]LogonEventArgs Class
   [Expand]LogonFailedEventArgs Class
    LookupEditCollectionSourceMode Enumeration
   [Expand]LookupEditPropertyCollectionSource Class
    MasterDetailMode Enumeration
   [Expand]MessageOptions Class
   [Expand]ModelCacheManager Class
   [Expand]ModelDifferenceStore Class
   [Expand]ModelStoreBase Class
   [Collapse]ModuleBase Class
     ModuleBase Members
     ModuleBase Constructor
    [Expand]ModuleBase Properties
    [Expand]ModuleBase Methods
   [Expand]NestedFrame Class
    Nesting Enumeration
    NewItemRowPosition Enumeration
    NewWindowTarget Enumeration
   [Expand]NonPersistentObjectSpace Class
   [Expand]ObjectChangedEventArgs Class
   [Expand]ObjectManipulatingEventArgs Class
   [Expand]ObjectsCountGettingEventArgs Class
   [Expand]ObjectsManipulatingEventArgs Class
   [Expand]ObjectSpaceCreatedEventArgs Class
   [Expand]ObjectView Class
   [Expand]ObjectViewController Class
   [Expand]ObjectViewController<ViewType, ObjectType> Class
   [Expand]ProcessActionContainerEventArgs Class
   [Expand]PropertyCollectionSource Class
    SchemaUpdateMode Enumeration
   [Expand]SecuritySystem Class
    SelectionType Enumeration
   [Expand]ShowViewParameters Class
   [Expand]ShowViewSource Class
   [Expand]ShowViewStrategyBase Class
    TargetWindow Enumeration
   [Expand]TemplateContext Structure
    UIType Enumeration
   [Expand]ValidateObjectEventArgs Class
   [Expand]View Class
   [Expand]ViewController Class
   [Expand]ViewController<ViewType> Class
   [Expand]ViewCreatedEventArgs Class
   [Expand]ViewCreatingEventArgs Class
   [Expand]ViewItemsChangedEventArgs Class
    ViewItemsChangedType Enumeration
   [Expand]ViewShortcut Class
   [Expand]ViewShowingEventArgs Class
   [Expand]ViewShownEventArgs Class
    ViewType Enumeration
   [Expand]WebMessageOptions Class
   [Expand]Window Class
   [Expand]WindowController Class
    WindowType Enumeration
   [Expand]WinMessageOptions Class
    WinMessageType Enumeration
   [Expand]XafApplication Class
   [Expand]XafDataView Class
   [Expand]XafDataViewRecord Class
   [Expand]XafInstantFeedbackRecord Class
  [Expand]DevExpress.ExpressApp.Actions
  [Expand]DevExpress.ExpressApp.AuditTrail
  [Expand]DevExpress.ExpressApp.Chart
  [Expand]DevExpress.ExpressApp.Chart.Web
  [Expand]DevExpress.ExpressApp.Chart.Win
  [Expand]DevExpress.ExpressApp.CloneObject
  [Expand]DevExpress.ExpressApp.ConditionalAppearance
  [Expand]DevExpress.ExpressApp.Dashboards
  [Expand]DevExpress.ExpressApp.Dashboards.Web
  [Expand]DevExpress.ExpressApp.Dashboards.Win
  [Expand]DevExpress.ExpressApp.Data
  [Expand]DevExpress.ExpressApp.DC
  [Expand]DevExpress.ExpressApp.DC.ClassGeneration
  [Expand]DevExpress.ExpressApp.Editors
  [Expand]DevExpress.ExpressApp.EF
  [Expand]DevExpress.ExpressApp.EF.Utils
  [Expand]DevExpress.ExpressApp.FileAttachments.Web
  [Expand]DevExpress.ExpressApp.FileAttachments.Win
  [Expand]DevExpress.ExpressApp.Filtering
  [Expand]DevExpress.ExpressApp.HtmlPropertyEditor.Web
  [Expand]DevExpress.ExpressApp.HtmlPropertyEditor.Win
  [Expand]DevExpress.ExpressApp.Kpi
  [Expand]DevExpress.ExpressApp.Layout
  [Expand]DevExpress.ExpressApp.Maps.Mobile
  [Expand]DevExpress.ExpressApp.Maps.Mobile.Editors
  [Expand]DevExpress.ExpressApp.Maps.Web
  [Expand]DevExpress.ExpressApp.Maps.Web.Helpers
  [Expand]DevExpress.ExpressApp.MiddleTier
  [Expand]DevExpress.ExpressApp.Mobile
  [Expand]DevExpress.ExpressApp.Mobile.Editors
  [Expand]DevExpress.ExpressApp.Mobile.MobileModel
  [Expand]DevExpress.ExpressApp.Mobile.SystemModule
  [Expand]DevExpress.ExpressApp.Mobile.Templates
  [Expand]DevExpress.ExpressApp.Model
  [Expand]DevExpress.ExpressApp.Model.Core
  [Expand]DevExpress.ExpressApp.Model.NodeGenerators
  [Expand]DevExpress.ExpressApp.ModelEditor
  [Expand]DevExpress.ExpressApp.Notifications
  [Expand]DevExpress.ExpressApp.Notifications.Web
  [Expand]DevExpress.ExpressApp.Notifications.Win
  [Expand]DevExpress.ExpressApp.Office.Win
  [Expand]DevExpress.ExpressApp.PivotChart
  [Expand]DevExpress.ExpressApp.PivotChart.Web
  [Expand]DevExpress.ExpressApp.PivotChart.Win
  [Expand]DevExpress.ExpressApp.PivotGrid
  [Expand]DevExpress.ExpressApp.PivotGrid.Web
  [Expand]DevExpress.ExpressApp.PivotGrid.Win
  [Expand]DevExpress.ExpressApp.Reports
  [Expand]DevExpress.ExpressApp.Reports.Web
  [Expand]DevExpress.ExpressApp.Reports.Win
  [Expand]DevExpress.ExpressApp.ReportsV2
  [Expand]DevExpress.ExpressApp.ReportsV2.Mobile
  [Expand]DevExpress.ExpressApp.ReportsV2.Web
  [Expand]DevExpress.ExpressApp.ReportsV2.Win
  [Expand]DevExpress.ExpressApp.Scheduler
  [Expand]DevExpress.ExpressApp.Scheduler.Web
  [Expand]DevExpress.ExpressApp.Scheduler.Win
  [Expand]DevExpress.ExpressApp.ScriptRecorder
  [Expand]DevExpress.ExpressApp.ScriptRecorder.Web
  [Expand]DevExpress.ExpressApp.ScriptRecorder.Win
  [Expand]DevExpress.ExpressApp.Security
  [Expand]DevExpress.ExpressApp.Security.Adapters
  [Expand]DevExpress.ExpressApp.Security.ClientServer.Wcf
  [Expand]DevExpress.ExpressApp.Security.EF.Adapters
  [Expand]DevExpress.ExpressApp.Security.Strategy
  [Expand]DevExpress.ExpressApp.Security.Xpo.Adapters
  [Expand]DevExpress.ExpressApp.StateMachine
  [Expand]DevExpress.ExpressApp.SystemModule
  [Expand]DevExpress.ExpressApp.Templates
  [Expand]DevExpress.ExpressApp.Templates.ActionContainers
  [Expand]DevExpress.ExpressApp.TreeListEditors
  [Expand]DevExpress.ExpressApp.TreeListEditors.Web
  [Expand]DevExpress.ExpressApp.TreeListEditors.Win
  [Expand]DevExpress.ExpressApp.Updating
  [Expand]DevExpress.ExpressApp.Utils
  [Expand]DevExpress.ExpressApp.Validation
  [Expand]DevExpress.ExpressApp.Validation.Web
  [Expand]DevExpress.ExpressApp.Validation.Win
  [Expand]DevExpress.ExpressApp.ViewVariantsModule
  [Expand]DevExpress.ExpressApp.Web
  [Expand]DevExpress.ExpressApp.Web.Controls
  [Expand]DevExpress.ExpressApp.Web.Editors
  [Expand]DevExpress.ExpressApp.Web.Editors.ASPx
  [Expand]DevExpress.ExpressApp.Web.SystemModule
  [Expand]DevExpress.ExpressApp.Web.Templates
  [Expand]DevExpress.ExpressApp.Web.Utils
  [Expand]DevExpress.ExpressApp.Win
  [Expand]DevExpress.ExpressApp.Win.Core
  [Expand]DevExpress.ExpressApp.Win.Editors
  [Expand]DevExpress.ExpressApp.Win.Model
  [Expand]DevExpress.ExpressApp.Win.SystemModule
  [Expand]DevExpress.ExpressApp.Win.Templates
  [Expand]DevExpress.ExpressApp.Win.Templates.Navigation
  [Expand]DevExpress.ExpressApp.Win.Utils
  [Expand]DevExpress.ExpressApp.Workflow
  [Expand]DevExpress.ExpressApp.Workflow.Win
  [Expand]DevExpress.ExpressApp.Xpo
  [Expand]DevExpress.ExpressApp.Xpo.Utils
  [Expand]DevExpress.Persistent.Base
  [Expand]DevExpress.Persistent.Base.General
  [Expand]DevExpress.Persistent.Base.ReportsV2
  [Expand]DevExpress.Persistent.Base.Security
  [Expand]DevExpress.Persistent.BaseImpl
  [Expand]DevExpress.Persistent.BaseImpl.EF
  [Expand]DevExpress.Persistent.BaseImpl.EF.PermissionPolicy
  [Expand]DevExpress.Persistent.BaseImpl.PermissionPolicy
  [Expand]DevExpress.Persistent.Validation
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

ModuleBase Class

The base class for XAF Modules.

Namespace:DevExpress.ExpressApp
Assembly:DevExpress.ExpressApp.v19.1.dll

Expanded Syntax

Expanded Remarks

The presence of a ModuleBase class descendant in a standard Class Library project indicates that this project represents a module. Controllers, View Items and other XAF elements are loaded in the Application Model only when they are declared in modules. In addition, modules allow you to customize the Application Model when it is being loaded. For this purpose, override the ModuleBase class methods.

The following list represents the primary capabilities available by overriding the appropriate ModuleBase methods:

  • Speed-up Collecting Types Declared Within the Module

    Override the GetDeclaredExportedTypes method to customize the default behavior of exporting of all the assembly's business classes to the Application Model.

    Override the GetDeclaredControllerTypes method to customize the default behavior of exporting of all the assembly's Controllers to the Application Model.

    Override the protected GetRegularTypes method to return types that are declared within the module and are supposed to be collected automatically (business objects, DbContext descendants, Controllers, List and Property Editors, etc.). By default, this method returns all the types declared within the current module. Internally, it uses reflection for this purpose. You can improve the application performance by providing the list of types manually. Note that if you override the GetRegularTypes method, types declared within the module are no longer collected automatically, and you should manually register each new business object, Controller or Editor within this method. However, it is not necessary to register types that are already returned by overridden GetDeclaredExportedTypes and GetDeclaredControllerTypes methods.

  • Load Additional Modules

    Together with the current module, add modules with the required features to the Application Model using the GetRequiredModuleTypesCore method. The current module should have a reference to the modules to be added.

  • Add Custom Nodes and Properties

    Override the ExtendModelInterfaces method to add the required nodes or properties. If you need to add a custom node, first declare its interface by inheriting the IModelNode interface. See the Extend and Customize the Application Model in Code topic for details.

  • Update the Application Model Using the Generator Updaters

    Override the AddGeneratorUpdaters method to add Generator Updaters which update the Application Model.

  • Update the Database Using the Module Updaters

    Override the GetModuleUpdaters method to add ModuleUpdater objects that update the database.

  • Customize Types Info Subsystem

    Override the CustomizeTypesInfo method to customize information on a particular class or property, before it is loaded to the Application Model.

  • Register List or Property Editor

    Override the protected RegisterEditorDescriptor method to switch off the reflection mechanism, which collects information on the types decorated by the ListEditorAttribute and PropertyEditorAttribute attributes. This speeds up your application start. Note that in this case the Editors which are decorated by these attributes are not registered.

    Use the EditorDescriptorsFactory.RegisterListEditorAlias and EditorDescriptorsFactory.RegisterListEditor methods to register your List Editor with its alias.

    To register a Property Editor, use the EditorDescriptorsFactory.RegisterPropertyEditorAlias and EditorDescriptorsFactory.RegisterPropertyEditor methods.

    You can associate the EditorAliases enumerator value or a custom alias with a target type. It is possible to register one alias for WinForms and ASP.NET Editors in the base module project and locate suitable Editors in the platform-dependent projects. If you have platform-agnostic Editors for a specific type, specify a special string alias to use them in a platform-independent module. Note that the Editor registered for the Object type is used to display objects and properties of a type for which another Editor is not specified.

    The following example demonstrates how to register a default List Editor.

    See the list below to modify this example in accordance with your purposes.

    • Set the methods' elementType parameter to the Object type and set the isDefaultEditor parameter to false to add this Editor to the IModelViews.DefaultListEditor list of default List Editors. Then, you can choose this Editor in the Mobile Editor.
    • To register the default List Editor for objects of a specific type, pass the target type to the methods' elementType parameter and set the isDefaultEditor parameter to true to mark this Editor as default for the type.
    • Specify the target type in the methods' elementType parameter and set the isDefaultEditor parameter to false to add the List Editor to the IModelClass.EditorType list of List Editors for the specified type. Then, you can choose this Editor in the Mobile Editor.
    • Use the classHandler parameter of the RegisterListEditorAlias method if you want to register a number of Editors for one type and choose the appropriate Editor according to the logic implemented in it. In different situations, the Editor satisfying the conditions is applied to current type first.

    The following example demonstrates how to register a default Property Editor.

    Note

    To set your Property Editor as default for properties with protected content, implement the IProtectedContentEditor interface in your Property Editor.

    See the list below to modify this example in accordance with your purposes.

    • Set the methods' elementType parameter set to the Object type and set the isDefaultEditor parameter to false to add this Property Editor to the IModelRegisteredViewItem.DefaultItemType list of default Property Editors orIModelRegisteredPropertyEditors.ProtectedContentPropertyEditor if your Editor is for the properties with protected content. Then, you can choose this Editor in the Mobile Editor.
    • To register the default Property Editor for the properties of a specific type, pass the target type to the methods' elementType parameter and set the isDefaultEditor parameter to false to mark this Editor as default for the type.
    • Specify the target type in the methods' elementType parameter and set the isDefaultEditor parameter to false to add the Property Editor to the IModelRegisteredPropertyEditor.EditorType list of Property Editors for the specified type. Then, you can choose this Editor in the Mobile Editor.
    • Use the memberHandler parameter of the RegisterPropertyEditorAlias method if you want to register a number of Editors for properties of one type and choose the appropriate Editor according to the logic implemented in it. In different situations, the Editor satisfying the conditions is applied to current type first. Editors registered with this parameter have priority over Editors registered without it. For the Editor registered with the memberHandler parameter, the new node is created in the Model Editor's View Items | PropertyEditors node.

You do not have to create instances of the ModuleBase class descendants. They are created automatically.

To add a module to your application, use the Module Designer or Application Designer.

Expanded Inheritance Hierarchy

System.Object
    System.MarshalByRefObject
       System.ComponentModel.Component
          ModuleBase
             AuditTrailModule
             ChartAspNetModule
             ChartModule
             ChartWindowsFormsModule
             CloneObjectModule
             ConditionalAppearanceModule
             DashboardsAspNetModule
             DashboardsModule
             DashboardsWindowsFormsModule
             FileAttachmentsAspNetModule
             FileAttachmentsWindowsFormsModule
             HtmlPropertyEditorAspNetModule
             HtmlPropertyEditorWindowsFormsModule
             KpiModule
             MapsAspNetModule
             MapsMobileModule
             NotificationsModule
             OfficeModule
             OfficeWindowsFormsModule
             PivotChartAspNetModule
             PivotChartModuleBase
             PivotChartWindowsFormsModule
             PivotGridAspNetModule
             PivotGridModule
             PivotGridWindowsFormsModule
             ReportsAspNetModule
             ReportsAspNetModuleV2
             ReportsModule
             ReportsModuleV2
             ReportsWindowsFormsModule
             ReportsWindowsFormsModuleV2
             SchedulerAspNetModule
             SchedulerModuleBase
             SchedulerWindowsFormsModule
             ScriptRecorderAspNetModule
             ScriptRecorderModuleBase
             ScriptRecorderWindowsFormsModule
             SecurityModule
             StateMachineModule
             SystemAspNetModule
             SystemMobileModule
             SystemModule
             SystemWindowsFormsModule
             TreeListEditorsAspNetModule
             TreeListEditorsModuleBase
             TreeListEditorsWindowsFormsModule
             ValidationAspNetModule
             ValidationModule
             ValidationWindowsFormsModule
             ViewVariantsModule
             WorkflowModule
             WorkflowWindowsFormsModule

Expanded See Also

Is this topic helpful?​​​​​​​