StringEnumInfo class
namespace: Serenity assembly: Serenity.Net.Core
The members and lookups of a StringEnum type, which are built once for the type and cached by GetInfo.
public sealed class StringEnumInfo
Public Members
| name | description |
|---|---|
| EnumKey { get; } | Gets the key of the string enumeration, which is its EnumKeyAttribute value, or its full name. |
| Members { get; } | Gets all the members in their declaration order, including the ones hidden from the client. |
| Names { get; } | Gets the names of all the members in their declaration order. |
| Type { get; } | Gets the string enumeration type. |
| Values { get; } | Gets the values of all the members in their declaration order. |
| VisibleMembers { get; } | Gets the members that are sent to the client, in their declaration order. |
| FindByName(…) | Finds the member with the given name. |
| FindByValue(…) | Finds the member with the given value. |
Remarks
Only the members declared on the type itself are read, like the server typings generator, so a type deriving from another one has its own set. When two members have the same value, the one declared first is used, like the first icon of an alias in a numeric enum. All members are included, also the ones hidden from the client with IgnoreUIFieldAttribute or TransformIgnoreAttribute, as the server accepts them; IsVisible tells which ones are sent to the client.
See Also
- Source: StringEnumInfo.cs