title: Why can't enum types be underlying types that are integral types in the System namespace?
body: <p>I've done quite a bit of PInvoke stuff recently, wanting to stay close to the Windows API header files.</p>
  
  <p>When creating the <a href="http://msdn.microsoft.com/en-us/library/sbbt4032.aspx" rel="nofollow">enum</a> below, you get this compiler error:</p>
  
  <pre><code>Error   1   Type byte, sbyte, short, ushort, int, uint, long, or ulong expected 
  </code></pre>
  
  <p>Why is it that the C# compiler does not understand any other <a href="http://msdn.microsoft.com/en-us/library/sbbt4032.aspx#code-snippet-2" rel="nofollow">underlying types</a>?<br>
  The C# compiler can go from uint to System.UInt32, why not the other way around?</p>
  
  <pre><code>using System;
  using System.Runtime.InteropServices;
  
  using DWORD = System.UInt32;
  
  namespace BeSharp.Win32
  {
      [StructLayout(LayoutKind.Sequential)]
      internal class MOUSEINPUT
      {
          // ...
          MouseData mouseData; // DWORD
          // ...
  
          [Flags]
          internal enum MouseData : System.UInt32; // needs to be uint; you cannot do DWORD or System.UInt32 here
          {
              Nothing = 0x0000,
              XBUTTON1 = 0x0001,
              XBUTTON2 = 0x0002,
          }
          // ...
      }
  }
  </code></pre>