Ejemplo n.º 1
0
        private static void methodeService(delgateparm p, String txt)
        {
            List <int> list = new List <int>(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 });


            foreach (int i in p(list))
            {
                Console.WriteLine(txt + " - Le resulte est :{0:f2}", i);
            }

            Console.WriteLine("-------------------------------------------------");
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            delgateparm delegate1 = new delgateparm(methodeAdelgatepaire);

            methodeService(delegate1, "paire ");

            delgateparm delegate2 = new delgateparm(methodeAdelgateimpaire);

            methodeService(delegate2, "impaire");

            delgateparm delegate3 = new delgateparm(methodeAdelgateSupDe5);

            methodeService(delegate3, "superier de 5");

            Console.ReadKey();
        }