I have a function declared along the lines of:
public delegate void Callback<T>(T arg1) where T : EventT;
public void RegisterCallback<T>(Callback<T> callback) where T : EventT
I want to call this via reflection as the type in a particular instance isn't know to me at runtime, I'm trying
Type classType = Type.GetType (eventNameString);
MethodInfo baseMethod = eventDispatcher.GetType ().GetMethod ("RegisterCallback");
MethodInfo typedMethod = baseMethod.MakeGenericMethod(new Type[] {classType});
Which if I understand it correctly is now making a method to except this dynamic type, however my concern is how to pass the Callback parameter into the method invoke
typedMethod.Invoke (eventDispatcher, new object[] { ??? });
I'm not sure how I can declare a delegate to pass into the object[] params that will also be typed agaisnt classType, I'm fairly new to Csharp as well so am a little lost,
Thanks in advance