title: What's the best C# pattern for implementing a hierarchy with an enum?
body: <p>I'm implementing value types which represents a distance (or length). 
  There's an enum that represents the different units of measure, eg:</p>
  
  <pre><code>public enum DistanceUnit 
  {
     Millimeter,
     Centimeter,
     Meter,
     Kilometer,
     Inch,
     Foot,
     Yard,
     Mile
  };
  </code></pre>
  
  <p>These measurements fall into one of two systems - either metric or imperial. Since enum doesn't support hierachies, what's the best pattern for representing this hierarchy?</p>
  
  <p>Is it to use bit flags? 
  Or use two seperate enums along with some methods to correlate them? 
  Or to declare static members instead of enums?</p>
  
  <p>Give me some advice... how would <em>you</em> implement this?</p>
  
  <hr>
  
  <p>Edit - More clarification: 
  I have several immutable structs (generated by T4) which represent various measurements:</p>
  
  <pre><code>public struct Meters : IEquatable&lt;Distance&gt;, 
                         IEquatable&lt;Meters&gt;, 
                         IEquatable&lt;Millimeters&gt;, ... IComparable&lt;&gt; etc.. etc..
  {
      public readonly decimal Value;
      ...
      public static implicit operator Distance (Meters other) {
          // Can implicitly cast to Distance
      }
  }
  
  public struct Millimeters ...
  public struct Centimeters ....
  </code></pre>
  
  <p>... etc, as well as a hand-coded immutable Distance, intended to represent <em>any</em> measure:</p>
  
  <pre><code>public struct Distance : IEquatable&lt;Distance&gt;, 
                         IEquatable&lt;Meters&gt;, 
                         IEquatable&lt;Millimeters&gt;, ...
                         IFormattable
  {
  
      public readonly decimal Value;
      public readonly DistanceUnits UnitOfMeasure;
      ...
      public string ToString(string format, IFormatProvider provider)
      {
          // Logic:
          // If UOM = Meters and Value &lt; .1 then display as "10 cm" instead of ".1 M"
          // If UOM = Inches and value multiple of 12, display as feet
          // etc, etc
      }
  }
  </code></pre>
  
  <p>Foregoing a discussion about whether the Distance should be converted to the correct UOM by calling code, the goal here is for ToString to convert the value up or down on the same measurement (imperial or metric) that is represented by the current UnitOfMeasure.</p>
  
  <p>Obviously this could all be hard coded into the ToString method, but given that I'm also implementing TypeConverters and FormatProviders for this whole shibang, I'd like to find a generic means of figuring out, from a DistanceUnit, what the appropriate next-up or next-down unit of measure would be.</p>
  
  <p>Am I barking up the wrong tree by wanting to implement in this manner?</p>