title: C# Extend a Library Class to Rest of Program
body: <p>I have a public Library class with all the global variables needed for my program to work. It is structured like this:</p>
  
  <pre><code>public static class Library
  {
      public static string globalString = "";
  }
  </code></pre>
  
  <p>In other languages, it is possible to use <code>extends</code> to extend a class to another class so the 'Library' prefix is not required on global variables but in C# it works a bit differently. I tried adding it after the colon in the class I wanted to extend to (like this: <code>public partial class Login : Form, Library</code>) and I was told that "Classes cannot have multiple base classes". Apparently, it is possible to use interfaces to extend classes but I do not fully understand how that works or how to implement it.</p>