title: C# check for member of enum using input value
body: <p>Let's say I have an <code>enum</code> called <code>eEventID</code> that contains 10 events, <code>mEvent1 - mEvent10</code> with <code>int</code> values 10001 - 10010 . I want to use an input value (e.g. 10007) to check if a member in the enum has the corresponding value. Once I find the event with the corresponding input value, I then take that event and register a method to it by hooking up a delegate (This is assuming I have all the necessary code). I just need to know if a member in the enum has a value that is the same as the input value, then register a new method to that event. How do I look for a certain event using only an input value? I'm guessing a <code>for-loop</code> or any other loop isn't my best bet.</p>
  
  <p><strong>EDIT:</strong> this is what I have so far...</p>
  
  <pre><code>public delegate void EventDel(int mEvtIdx);
  
  public enum eVtEvtId
  {
      Event1,
      Event2,
      Event3,
      Event4,
      Event5,
      Event6,
      Event7,
      Event8,
      Event9,
      Event10,
  
  }
  
  public void Subscribe(int mInVal)
  {
      eVtEvtID mEventID;
      int mEventIndex = mInVal;
  
      if(Enum.IsDefined(typeof(mEventID), mEventIndex))
      {
          mEventID += EventDelegate([insert method here])
      }
  
      else
      {
          // will warn the user that the event does
          // not yet exist in the enum
      }
  
  }
  </code></pre>