Stored String value in ENUM
Code
public enum Modes
{
[Description("Value1")]
Pocket,
[Description("Value2")]
Scaning,
[Description("Value3")]
Pulse,
}
Get the
value
Modes eModes = Modes.Pocket;
String val1= eModes.GetDescription()
Modes eModes = Modes.Scaning;
String val2= eModes.GetDescription()
Modes eModes = Modes.Pulse;
String val3= eModes.GetDescription()
Output
Value1
Value2
Value3
No comments:
Post a Comment