Esempio n. 1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Calulating!!");
            AllCalc allCalc = Plus;

            allCalc += Minus;
            allCalc += Multipul;
            allCalc += Divide;
            allCalc(10, 5);

            Console.WriteLine("곱셈 메서드 제거");
            allCalc -= Multipul;
            allCalc(10, 5);
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            /*
             * Plus(10, 5);
             * Minus(10, 5);
             * Multiple(10, 5);
             * Divide(10, 5);
             */

            AllCalc allCalc = Plus;

            allCalc += Minus;
            allCalc += Multiple;
            allCalc += Divide;

            allCalc(10, 5);
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            Console.WriteLine("Calculating!!");
            AllCalc allCalc = new AllCalc(Plus);

            allCalc += Minus;
            allCalc += Multiple;
            allCalc += Divide;

            allCalc(10, 5);

            /*Plus(10, 5);
             * Minus(10, 5);
             * Multiple(10, 5);
             * Divide(10, 5);*/

            Console.WriteLine("곱셈 메서드 제거");
            allCalc -= Multiple;
            allCalc(10, 5);
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            Console.WriteLine("Calculating!");
            AllCalc allCalc = Plus;

            allCalc += Minus;
            allCalc += Multiple;
            allCalc += Divide;
            //대리자 사용했을 때


            allCalc(10, 5);
            // 대리자 사용 안했을때

            /*Plus(10, 5);
             * Minus(10, 5);
             * Multiple(10, 5);
             * Divide(10, 5); */

            Console.WriteLine("곱셈 메서드 제거");
            allCalc -= Multiple;
            allCalc(10, 5);
            //곱셈을 제거하고 나머지만 계산이 된다
        }