title: Alternative to writing many if statements?
body: <p>Here is my method:  </p>
  
  <pre><code>private void ConvertValues()  
  {  
      txtResult.Text = angles[cmbUnits1.SelectedIndex];  
      double value1 = Convert.ToDouble(txtValue1.Text);  
      double value2 = Convert.ToDouble(txtValue2.Text);  
      int unit1 = cmbUnits1.SelectedIndex;  
  }
  </code></pre>
  
  <p>What I want the method to do is to get the selected of the ComboBoxes and test the values. But I want to know if there is an alternative to this:  </p>
  
  <pre><code>if( angles[cmbUnits1.SelectedIndex].Equals("Degrees") &amp;&amp; 
      angles[cmbUnits2.SelectedIndex].Equals("Radians")) {  
      ...  
  }
  </code></pre>
  
  <hr>
  
  <p>By the way, I'm making a kind of unit converter so I will have sections other than angles. So I would like some enum, interface, abstract class, or class that I can implement. Maybe a class with the name Unit? So I can create new objects like <code>Unit degrees = new Unit(Units.Angle)</code> with Units as an enum. Or just <code>Unit sqrMillimeters = new Unit("Area");</code>?</p>