Exemplo n.º 1
0
        static void Main(string[] args)
        {
            saldelegate deleg  = new saldelegate(getsalary);
            var         salary = deleg.Invoke(30, 800);

            Console.WriteLine("salary={0}", salary);
            //deleg=new saldelegate(getincentives);
            deleg += getincentives;  //referencing more than one method
            var incent = deleg.Invoke(30, 800);

            Console.WriteLine("incentives={0}", incent);
            Console.ReadKey();
        }
        static void Main(string[] args)
        {
            saldelegate deleg  = new saldelegate(Getsalary);
            var         salary = deleg.Invoke(20, 200);

            Console.WriteLine("salary= {0}", salary);
            //deleg = new saldelegate(Getincentive);
            deleg += Getincentive;
            var incent = deleg.Invoke(30, 800);

            Console.WriteLine("incentives = {0}", incent);
            Console.ReadKey();
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            saldelegate deleg  = new saldelegate(getsalary);
            var         salary = deleg.Invoke(30, 800);

            Console.WriteLine("salary = {0}"; salary);
            Console.ReadKey();
        }