public int DelegateA(BB b) { DD d = new DD(); delegateMethod dM = new delegateMethod(d.MethodD); return(dM(b)); }
private void button1_Click(object sender, EventArgs e) { Del deleg = new Del(); delegateMethod addNumber = new delegateMethod(deleg.add); addNumber(10, 20); }
static public void ChangeText(string text) { if (splashForm != null) { delegateMethod addNumbers = new delegateMethod(SplashForm.ExecutechangeText); splashForm.Invoke(addNumbers, text); } }
public static void Main(string[] args) { delegateMethod del = delegate { Console.WriteLine("Give me your name :\n"); Console.WriteLine("\nThe anonymous delegate method is called by : {0}", (Console.ReadLine()).ToUpper()); }; del(); Console.ReadLine(); }
static void myMethod3(delegateMethod x) { Console.WriteLine("Now we call delegate from method 3:"); x(); }