title: Get a property value with only the object and the name of the property (but not the type)
body: <p>Suppose I have a method that passes in the name of a property (as a <code>string</code>) and the object that the property is on (as <code>object</code>).</p>
  
  <p>How could I get the value of the property?</p>
  
  <p>Here is some code to make it a bit more concrete:</p>
  
  <pre><code>protected override void Paint(Graphics g, Rectangle bounds, CurrencyManager source, int rowNum, Brush backBrush, Brush foreBrush, bool alignToRight)
  {
     // The next line is made up code
     var currentValue = source.Current.CoolMethodToTakePropertyNameAndReturnValue(MappingName);
  
     // Paint out the retrieved value
     g.DrawString(currentValue.ToString() , _gridFont, new SolidBrush(Color.Black), bounds.Left + 1, bounds.Top);
  }
  </code></pre>
  
  <p>MappingName is the name of the property I want to get the value for.  What I need is <code>CoolMethodToTakePropertyNameAndReturnValue</code>.</p>
  
  <p>Any ideas?  I am running on the Compact Framework.  I would also prefer to avoid reflection (but if that is my only recourse then so be it).</p>
  
  <p>Thanks for any help.</p>