title: Use string indexer on custom class
body: <p>I have a simple class:</p>
  
  <pre><code>public class MyClass
  {
    public string MyClassName { get; private set; }
    public string MyClassValue { get; private set; }
  }
  </code></pre>
  
  <p>And I want to hold an array of MyClass objects like this:</p>
  
  <pre><code>MyClass[] myClasses = new MyClass[5];
  </code></pre>
  
  <p>Is it possible, without creating a "collection" object, to be able to access one of those objects in the array of objects by the string indexer (is that the right terminology)?</p>
  
  <p>For example, if myClasses[2] has the value "andegre" in the MyClassName property, how/can I access it like this:</p>
  
  <pre><code>MyClass andegre = myClasses["andegre"];
  </code></pre>
  
  <p>Instead of doing something like:</p>
  
  <pre><code>MyClass andegre = myClasses[GetIndexOfOfMyClassName("andegre")];
  </code></pre>
  
  <p>TIA</p>