Exemplo n.º 1
0
        public int DelegateA(BB b)
        {
            DD             d  = new DD();
            delegateMethod dM = new delegateMethod(d.MethodD);

            return(dM(b));
        }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Del            deleg     = new Del();
            delegateMethod addNumber = new delegateMethod(deleg.add);

            addNumber(10, 20);
        }
Exemplo n.º 3
0
 static public void ChangeText(string text)
 {
     if (splashForm != null)
     {
         delegateMethod addNumbers = new delegateMethod(SplashForm.ExecutechangeText);
         splashForm.Invoke(addNumbers, text);
     }
 }
Exemplo n.º 4
0
        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();
        }
Exemplo n.º 5
0
 static void myMethod3(delegateMethod x)
 {
     Console.WriteLine("Now we call delegate from method 3:");
     x();
 }