Back to Devexpress

EnumDescriptor Class

expressappframework-devexpress-dot-expressapp-dot-utils-db815185.md

latest2.3 KB
Original Source

EnumDescriptor Class

Supplies metadata information on an enumeration used in an XAF application.

Namespace : DevExpress.ExpressApp.Utils

Assembly : DevExpress.ExpressApp.v25.2.dll

NuGet Package : DevExpress.ExpressApp

Declaration

csharp
public class EnumDescriptor :
    IEnumDescriptor
vb
Public Class EnumDescriptor
    Implements IEnumDescriptor

Remarks

The EnumDescriptor class’ properties and methods provide access to the enumeration metadata - the enumeration values, associated display captions and image. The most useful members of the EnumDescriptor class are the EnumDescriptor.GetCaption and EnumDescriptor.GetImageInfo methods. The following code snippet illustrates their use. The code retrieves images and display captions associated with MyEnum enumeration values.

csharp
using System.Drawing;
//...
EnumDescriptor myDescriptor = new EnumDescriptor(typeof(MyEnum));
foreach(object enumValue in myDescriptor.Values) {
    string caption = myDescriptor.GetCaption(enumValue);
    var image = myDescriptor.GetImageInfo(enumValue).Image;
    //process caption and image
}

Inheritance

Object EnumDescriptor

See Also

EnumDescriptor Members

How to: Set Images and Captions for Enumeration Values

Add an Action with Option Selection

DevExpress.ExpressApp.Utils Namespace