示例#1
0
        static void Main(string[] args)
        {
            Math test = new Math();

            test.Add(4, 2);



            Console.ReadLine();

            //Create math proxy from RealWorld.cs
            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));

            //Input for the next Proxy result
            Console.ReadLine();

            //Create Proxy and request a service
            Proxy proxy = new Proxy();

            proxy.Request();

            //Wait for user
            Console.ReadKey();
        }
        /// <summary>
        /// Entry point into console application.
        /// </summary>
        public void Execute()
        {
            // 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));
        }
        /// <summary>
        /// Entry point into console application.
        /// </summary>
        private static void Main()
        {
            // 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();
        }
        /// <summary>
        /// Entry point into console application.
        /// </summary>
        private static void Main()
        {
            // 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();
        }