title: How to add string indexer to CollectionBase
body: <p>I'm dealing with a class written by a third party that implements System.Collections.CollectionBase:</p>
  
  <pre><code>public class Palette : CollectionBase, ICloneable
  </code></pre>
  
  <p>The only rub I have with it is that I can only access its elements via integer index: [0], [1], [2]. I need to enhance this class' functionality so that I can access an element via a string so I can do something like this:</p>
  
  <pre><code>["asian"] = Color.Yellow, ["black"] = Color.Black, ["White"] = Color.White
  </code></pre>
  
  <p>So I attempted to wrap this up in my own class.  So far I have:</p>
  
  <pre><code>public class NamedPalette : Palette
  {
      private Dictionary&lt;string, PaletteEntry&gt; paletteEntries =
          new Dictionary&lt;string, PaletteEntry&gt;();
  
      public PaletteEntry this[string key]
      {
          get { return paletteEntries[key]; }
          set { paletteEntries.Add(key, value); }
      }
      public NamedPalette()
      {
  
      }
  }
  public class PaletteEntry
  {
      private Color color;
      private Color color2;
      public PaletteEntry(Color color, Color color2)
      {
          this.color = color;
          this.color2 = color2;
      }
  }
  </code></pre>
  
  <p>Am I on the right track here?  Not sure what to do next.</p>