internal static void InvokeDelegate (Delegate d, object[] args)
{
if (d is Action) {
((Action)d) ();
}
else if (d is SendOrPostCallback) {
((SendOrPostCallback)d) (args[0]);
}
else if (d is EventHandler) {
((EventHandler)d) (args[0], (EventArgs)args[1]);
}
else if (d is Deployment.AssemblyRegistration) {
((Deployment.AssemblyRegistration)d) ((Assembly)args[0]);
}
else {
#if DEBUG
Console.WriteLine ("slow path Dispatcher.InvokeDelegate, delegate type is {0}", d.GetType());
#endif
d.DynamicInvoke (args);
}
}