access to methods in Object type
<p>I'm trying to figure out how to do something like the following (that was typed off the top of my head so it might not be 100% accurate, but it should get the point across) in csharp, but I'm not really sure how.</p>

<pre><code>class Test
{
  private __construct() {}

  public static function GetInstance($name)
  {
      if (file_exists($name . ".php"))
      {
            return new $name();
      }
      else
      {
            return null;
      }
  }
}
</code></pre>

<p>I know how to get the object I want back based on the input, but I have to return an Object, because I'm not sure which one the caller will request. However, when I have no idea how to get access to the methods in the returned Object.</p>
