title: Proper way to map combo box lines to their corresponding strategy objects?
body: <p>I have a situation that is pretty simple, and I'd like to know the ideal way to do it.</p>
  
  <p>I have a combo box.  Each line of the combo box corresponds to a particular strategy object.  </p>
  
  <p>What is the proper way to map the combo box lines to the strategy object.  </p>
  
  <p>The way I was doing it seems overly complicated, and I'm pretty much guaranteed there is a simple standard way to do this.</p>
  
  <p>Thank you.</p>
  
  <p>EDIT: </p>
  
  <p>I had the data in a Dictionary, where the string was the text for the combobox, and the object was the strategy...  But this isn't ordered...  And I just know there is some extremely simple way to do it.</p>
  
  <p>SOLUTION:
  I used this solution, not feeling comfortable putting presentation logic in the data classes:</p>
  
  <pre><code>private partial class HtmlTransformState : AbstractHtmlEditFormState
  {
  private Dictionary&lt;string, ITransformStrategy&gt; strategies = new Dictionary&lt;string, ITransformStrategy&gt;() 
  { 
      { "Simple URL", new TransformStrategy&lt;SimpleUrlCodeExtractor&gt;() }, 
      { "Overview", new TransformStrategy&lt;OverviewCodeExtractor&gt;() },  
      { "Video List", new TransformStrategy&lt;VideoListCodeExtractor&gt;() }, 
      { "Video List No MbORKb", new TransformStrategy&lt;VideoListNoMBOrKBAndNoLinksAllowedCodeExtractor&gt;() },
      { "Blue Mountain 2007", new TransformStrategy&lt;BlueMountain2007CodeExtractor&gt;() },
      { "Four Gates", new TransformStrategy&lt;FourGatesCodeExtractor&gt;() },
      { "General", new TransformStrategy&lt;GeneralCodeExtractor&gt;() }
  };
  public override void DrawForm()
  {
      // ...
      ParentForm.cmboTransformStrategy.DataSource = new BindingSource(strategies, null);
      ParentForm.cmboTransformStrategy.DisplayMember = "Key";
      ParentForm.cmboTransformStrategy.ValueMember = "Value";
  }
  
  public override IEnumerable&lt;string&gt; ProcessHtml(string urlPath)
  {
      ITransformStrategy transformStrategy = (ITransformStrategy)ParentForm.cmboTransformStrategy.SelectedValue;
  
      // Do some stuff with 'transformStrategy'
  }
  </code></pre>
  
  <p>}</p>