Michael Minutillo wrote:
Try this:
public void SomeMethod()
{
  var vars = new object();
  var genericMethod = GetType().GetMethod("load");
var types = new[] { typeof(Settings), typeof(CatPictures), typeof(OtherMemes) };
  foreach(var type in types)
  {
    genericMethod.MakeGenericMethod(type).Invoke(this, new[] { vars });
  }
}

There are some optimisations that could make this better but it's a good start.


Hey Michael,

Thanks heaps, exactly what I wanted. :)
--
Les Hughes
[email protected]

Reply via email to