public delegate void D1(C c, string s);
public delegate void D2(string s);
public delegate void D3();
// A sample class with an instance method and a static method.
public class C
{
private int id;
public C(int id)
{
this.id = id;
}
public void M1(string s)
{
Console.WriteLine(“Instance method M1 on C: id = {0}, s = {1}”,
this.id, s);
}
public static void M2(string s)
{
Console.WriteLine(“Static method M2 on C: s = {0}”, s);
}
}
public class Example
{
public static void Main()
{
C c1 = new C(42);
MethodInfo mi1 = typeof©.GetMethod(“M1”, BindingFlags.Public | BindingFlags.Instance);
MethodInfo mi2 = typeof©.GetMethod(“M2”, BindingFlags.Public | BindingFlags.Static);
D1 d1;
D2 d2;
D3 d3;
Console.WriteLine("/nAn instance m