using System;
using System.Reflection;
using System.Reflection.Emit;
public class Example
{
private static object timer;
public static void Main()
{
string fullName = "";
foreach (Assembly assem in AppDomain.CurrentDomain.GetAssemblies())
{
if (assem.GetName().Name == "mscorlib")
{
fullName = assem.FullName;
}
}
Assembly sys = Assembly.Load("System" + fullName.Substring(fullName.IndexOf(",")));
Type t = sys.GetType("System.Timers.Timer");
timer = Activator.CreateInstance(t);
EventInfo eInfo = t.GetEvent("Elapsed");
Type handlerType = eInfo.EventHandlerType;
MethodInfo invokeMethod = handlerType.GetMethod("Invoke");
ParameterInfo[] parms = invokeMethod.GetParameters();
Type[] parmTypes = new Type[parms.Length];
for (int i = 0; i < parms.Length; i++)
{
parmTypes[i] = parms[i].ParameterType;
}
}
}