예제 #1
0
        static void Main()
        {
            MathProxy proxy = new MathProxy();


            Console.WriteLine("10 + 2 = " + proxy.Add(4, 2));
            Console.WriteLine("10 - 2 = " + proxy.Sub(4, 2));
            Console.WriteLine("10 * 2 = " + proxy.Mul(4, 2));
            Console.WriteLine("10 / 2 = " + proxy.Div(4, 2));

            Console.ReadKey();
        }
예제 #2
0
        static void Main(string[] args)
        {
            // Create math proxy
            MathProxy proxy = new MathProxy();

            // Do the math
            Console.WriteLine("4 + 2 = " + proxy.Add(4, 2));
            Console.WriteLine("4 - 2 = " + proxy.Sub(4, 2));
            Console.WriteLine("4 * 2 = " + proxy.Mul(4, 2));
            Console.WriteLine("4 / 2 = " + proxy.Div(4, 2));
            // Wait for user
            Console.ReadKey();
        }
예제 #3
0
        static void Main(string[] args)
        {
            //proxy
            Proxy proxy = new Proxy();

            proxy.Request();

            //Example as below
            MathProxy mathProxy = new MathProxy();

            Console.WriteLine("4 + 2 = " + mathProxy.Add(4, 2));
            Console.WriteLine("4 - 2 = " + mathProxy.Sub(4, 2));
            Console.WriteLine("4 * 2 = " + mathProxy.Mul(4, 2));
            Console.WriteLine("4 / 2 = " + mathProxy.Div(4, 2));
            Console.ReadKey();
        }
예제 #4
0
        static void Main(string[] args)
        {
            MathProxy proxy = new MathProxy();

            double addresult = proxy.Add(2, 3);
            Console.WriteLine(addresult);

            double subresult = proxy.Sub(2, 3);
            Console.WriteLine(subresult);

            double mulresult = proxy.Mul(2, 3);
            Console.WriteLine(mulresult);

            double devresult = proxy.Dev(2, 3);
            Console.WriteLine(devresult);

            Console.Read();
        }
예제 #5
0
        static void Main(string[] args)
        {
            // Create proxy and request a service
            Proxy proxy = new Proxy();

            proxy.Request();

            //x
            // Create math proxy
            MathProxy proxy2 = new MathProxy();

            // Do the math
            Console.WriteLine("4 + 2 = " + proxy2.Add(4, 2));
            Console.WriteLine("4 - 2 = " + proxy2.Sub(4, 2));
            Console.WriteLine("4 * 2 = " + proxy2.Mul(4, 2));
            Console.WriteLine("4 / 2 = " + proxy2.Div(4, 2));

            Console.ReadKey();
        }