The requested page is not available for the requested platform. You are viewing the content for Default platform.

EnumDescriptor.GenerateDefaultCaptions(IModelLocalizationGroup, Type) Method

Generates LocalizationItem nodes corresponding to the values of an enumeration.

Namespace: DevExpress.ExpressApp.Utils

Assembly: DevExpress.ExpressApp.v19.1.dll


public static void GenerateDefaultCaptions(
    IModelLocalizationGroup nodeGroup,
    Type enumType
Public Shared Sub GenerateDefaultCaptions(
    nodeGroup As IModelLocalizationGroup,
    enumType As Type


Name Type Description
nodeGroup IModelLocalizationGroup

An IModelLocalizationGroup object representing the LocalizationGroup node where LocalizationItem child nodes will be created.

enumType Type

A Type object representing the enumeration for which LocalizationItem nodes will be generated.


Calling this GenerateDefaultCaptions method overload is equivalent to calling the GenerateDefaultCaptions method overload that takes the compoundNameConvertStyle parameter, with the CompoundNameConvertStyle.SplitAndCapitalization value.

Since localization nodes for enumerations used as types of persistent properties are automatically generated, generally, you do not need to use the GenerateDefaultCaptions method. Nevertheless, you can use this method to create localization nodes for an arbitrary enumeration by implementing a Generator Updater. The following code snippet illustrates this.

using DevExpress.ExpressApp.Model;
using DevExpress.ExpressApp.Model.Core;
using DevExpress.ExpressApp.Model.NodeGenerators;
public enum MyEnum {
public class MyEnumUpdater : ModelNodesGeneratorUpdater<ModelLocalizationNodesGenerator> {
    public override void UpdateNode(ModelNode node) {
            typeof(MyEnum).FullName), typeof(MyEnum));

To register the Generator Updater, the ModuleBase.AddGeneratorUpdaters method should be overridden.

public sealed partial class MyModule : ModuleBase {
    public override void AddGeneratorUpdaters(
        DevExpress.ExpressApp.Model.Core.ModelNodesGeneratorUpdaters updaters) {
        updaters.Add(new MyEnumUpdater());

This will generate a new group under the Localization | Enums node.


See Also