I saw it referenced in a post here and now I'm kicking myself for not marking it.
Is there a way to enumerate through your enums?
Supose you have:
I know I can do this:
I'm looking for something along the lines of:
I'm really mad I can't remember it. Something to do with current assemblies? I dunno.
Any ideas?
Is there a way to enumerate through your enums?
Supose you have:
Code:
public enum PeriphType
{
PTYPE_ERROR,
PTYPE_NONE,
PTYPE_HOST,
PTYPE_TEMPHUM,
PTYPE_DUST,
PTYPE_AIRPRESS,
PTYPE_DCVOLTS
};
Code:
string mys=PeriphType.PTYPE_NONE.ToString(); //mys is now ="PTYPE_NONE"
Code:
foreach(<something> i in <auto-collection of all the PerhipType enums>)
{
string mys=i.ToString();
}
Any ideas?
Comment