the syntax of the GetInvocationList method: delegate [] GetInvocationList()
using System;
public delegate void DelegateClass();
public class Starter {
public static void Main() {
DelegateClass del = (DelegateClass)
DelegateClass.Combine(new DelegateClass[] { MethodA, MethodB, MethodA, MethodB });
del();
foreach (DelegateClass item in
del.GetInvocationList()) {
Console.WriteLine(item.Method.Name + " in invocation list.");
}
}
public static void MethodA() {
Console.WriteLine("MethodA...");
}
public static void MethodB() {
Console.WriteLine("MethodB...");
}
}
Related examples in the same category