K
Kyle Novak
What I want to do is take the values of an enum and have a related textual
description for each item. For example, if I have an enum declared as the
following...
[Flags]
public enum EqualityOperator
{
Equal = 1,
LessThan = 2,
GreaterThan = 4,
BeginsWith = 8,
EndsWith = 16,
Contains = 32,
All = Equal | LessThan | GreaterThan | BeginsWith
| EndsWith | Contains
}
.... I want a related textual description of "Greater Than", "Begins With",
etc. I don't want to use the text description of "BeginsWith" (that's one
word) by calling this line of code...
string format = Enum.Format(typeof(EqualityOperator),
EqualityOperator.BeginsWith, "g"); //Returns "BeginsWith" - one word
Because I want this "object" to be data bindable, I guess I could use the
CollectionBase object. I'm just looking for other ways/opinions on how to
do this.
Thanks,
Kyle
description for each item. For example, if I have an enum declared as the
following...
[Flags]
public enum EqualityOperator
{
Equal = 1,
LessThan = 2,
GreaterThan = 4,
BeginsWith = 8,
EndsWith = 16,
Contains = 32,
All = Equal | LessThan | GreaterThan | BeginsWith
| EndsWith | Contains
}
.... I want a related textual description of "Greater Than", "Begins With",
etc. I don't want to use the text description of "BeginsWith" (that's one
word) by calling this line of code...
string format = Enum.Format(typeof(EqualityOperator),
EqualityOperator.BeginsWith, "g"); //Returns "BeginsWith" - one word
Because I want this "object" to be data bindable, I guess I could use the
CollectionBase object. I'm just looking for other ways/opinions on how to
do this.
Thanks,
Kyle