Searching on groups of enumerator's members

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Craig Kenisston (CraigKenisston_at_hotmail.com)
Date: 09/11/04


Date: Sat, 11 Sep 2004 15:25:41 -0500


Hi,

If have an enumerator like :

public enum {
op1,
op2,
op3,
op4,
op5}
// real list will contain about 30 members.

And I want to, let's say, group them in odd and evens, just to say an
example.
Then, I would be want to be able to say :

if (myOp.OpX is in the list of odd operators)

or do :

if (myOp.OpX is in the list of even operators)

What 's the C# approach to do this ?

I would this in Delphi very easy, but I don't find the C#'s correspoding
approach.

Regards,