title: Reproducing some bit shift code from C++ to C#
body: <p>I'm trying to convert an enum from C++ code over to C# code, and I'm having trouble wrapping my head around it.  The C++ code is:</p>
  
  <pre><code>enum FOO {
    FOO_1 = 0,
    FOO_2,
    // etc
   }
  
  #define MASK(x)  ((1 &lt;&lt; 16) | (x))
  
  enum DISP
  {
    DISP_1 = MASK(FOO_1),
    DISP_2 = MASK(FOO_2),
    // etc
  }
  </code></pre>
  
  <p>What I don't understand is what MASK is doing, and how I can either emulate the functionality in C#, or understand what it's doing and set the enum DISP manually without it.</p>
  
  <p>I'm not sure what I'm saying is making sense, but that's to be expected when I'm not entirely certain what I'm looking at.  </p>