EnumDescriptor.GenerateDefaultCaptions(IModelLocalizationGroup, Type, CompoundNameConvertStyle) Method

Generates LocalizationItem nodes corresponding to the values of an enumeration.

Namespace: DevExpress.ExpressApp.Utils

Assembly: DevExpress.ExpressApp.v18.1.dll


public static void GenerateDefaultCaptions(
    IModelLocalizationGroup nodeGroup,
    Type enumType,
    CompoundNameConvertStyle compoundNameConvertStyle


Type Name Description
IModelLocalizationGroup nodeGroup

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

Type enumType

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

CompoundNameConvertStyle compoundNameConvertStyle

A CompoundNameConvertStyle enumeration value specifying how enumeration values are converted into the LocalizationItem nodes' IModelLocalizationItem.Value property values.

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.