title: How do I alias a class name in C#, without having to add a line of code to every file that uses the class?
body: <p>I want to create an alias for a class name. The following syntax would be perfect:</p>
  <pre><code>public class LongClassNameOrOneThatContainsVersionsOrDomainSpecificName
  {
     ...
  }
  
  public class MyName = LongClassNameOrOneThatContainsVersionOrDomainSpecificName;
  </code></pre>
  <p>but it won't compile.</p>
  <hr />
  <h2>Example</h2>
  <p><strong>Note</strong> This example is provided for convenience only. Don't try to solve this particular problem by suggesting changing the design of the entire system. The presence, or lack, of this example doesn't change the original question.</p>
  <p>Some existing code depends on the presence of a static class:</p>
  <pre><code>public static class ColorScheme
  {
     ...
  }
  </code></pre>
  <p>This color scheme is the Outlook 2003 color scheme. i want to introduce an Outlook 2007 color scheme, while retaining the Outlook 2003 color scheme:</p>
  <pre><code>public static class Outlook2003ColorScheme
  {
     ...
  }
  
  public static class Outlook2007ColorScheme
  {
     ...
  }
  </code></pre>
  <p>But i'm still faced with the fact that the code depends on the presence of a static class called <code>ColorScheme</code>. My first thought was to create a <code>ColorScheme</code> class that I will inherit from either <code>Outlook2003</code> or <code>Outlook2007</code>:</p>
  <pre><code>public static class ColorScheme : Outlook2007ColorScheme
  {
  }
  </code></pre>
  <p>but you cannot inherit from a static class.</p>
  <p>My next thought was to create the static <code>ColorScheme</code> class, but make <code>Outlook2003ColorScheme</code> and <code>Outlook2007ColorScheme</code> classes non-static. Then a static variable in the static <code>ColorScheme</code> class can point to either &quot;true&quot; color scheme:</p>
  <pre><code>public static class ColorScheme
  {
      private static CustomColorScheme = new Outlook2007ColorScheme();
      ...
  }
  
  private class CustomColorScheme 
  { 
     ...
  }
  
  private class Outlook2008ColorScheme : CustomColorScheme 
  {
      ...
  }
  
  private class Outlook2003ColorScheme : CustomColorScheme 
  {
     ...
  }
  </code></pre>
  <p>but that would require me to convert a class composed entirly of readonly static Colors into overridable properties, and then my <code>ColorScheme</code> class would need to have the 30 different property getters thunk down into the contained object.</p>
  <p>That's just too much typing.</p>
  <p>So my next thought was to alias the class:</p>
  <pre><code>public static ColorScheme = Outlook2007ColorScheme;
  </code></pre>
  <p>But that doesn't compile.</p>
  <p>How can I alias a static class into another name?</p>
  <hr />
  <p><strong>Update:</strong> Can someone please add the answer <em>&quot;You cannot do this in C#&quot;</em>, so I can mark that as the accepted answer. Anyone else wanting the answer to the same question will find this question, the accepted answer, and a number of workarounds that might, or might not, be useful.</p>
  <p>I just want to close this question out.</p>