How to access a custom collection property by its property name
<p>I want to implement a custom collection that contains instances of my class.</p>

<p>This is my class, a bit simplified here.</p>

<pre><code>public class Property : IComparable&lt;Property&gt; 
{
   public string Name;
   public string Value;
   public string Group;
   public string Id;
   ...
   ...

   public int CompareTo(Property other)
   {
      return Name.CompareTo(other.Name);
   }
}
</code></pre>

<p>I am adding instances of Property to a List collection</p>

<pre><code>Public List&lt;Property&gt; properties;
</code></pre>

<p>I can iterate through properties or access a specific property through the index position.</p>

<p>I want to however be able to access the property by its Name such that</p>

<pre><code>var myColor = properties["Color"].Value;
</code></pre>

<p>and I do not have an efficient way to do this. I assume that properties should be written as a custom list collection class to achieve this. Does anyone have a code sample I can look at?</p>

<p>Thanks for the help.</p>
