static void Main(string[] args)
        {
            Console.WriteLine("***Example of a Multicast Delegate***");
            MultiDel md = new MultiDel(show1);

            md += show2;
            md += show3;
            md();
            Console.ReadKey();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("***Testing a Multicast Delegate***");
            MultiDel md = new MultiDel(Sum);

            md += Difference;
            md += Multiply;
            int c = md(10, 5);

            Console.WriteLine("Analyzing the value of c");
            Console.WriteLine("c={0}", c);
            //md(200, 3);//ok
            Console.ReadKey();
        }