title: Generate random enum in C# 2.0
body: <p>Could someone please point me toward a cleaner method to generate a random enum member. This works but seems ugly.</p>
  
  <p>Thanks!</p>
  
  <pre><code>public T RandomEnum&lt;T&gt;()
  {
    string[] items = Enum.GetNames(typeof( T ));
    Random r = new Random();
    string e = items[r.Next(0, items.Length - 1)];
    return (T)Enum.Parse(typeof (T), e, true);
  }
  </code></pre>