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

            Console.WriteLine("res = " + client.Add(9, 1));
            Console.ReadLine();
        }
示例#2
0
        static void Main(string[] args) 
        {
            using (MyMathClient proxy = new MyMathClient())
            {
                int result = proxy.AddInt(35, 38);
                Console.WriteLine("result: {0}", result);

                double result0 = proxy.AddDouble(35, 38);
                Console.WriteLine("result: {0}", result0);

                MathResult result1 = proxy.Total(35, 38);
                Console.WriteLine("result: {0} {1} {2} {3}", result1.Sum, result1.Sub, result1.Mult, result1.Div);

                Console.WriteLine("Async Call");
                proxy.BeginAddInt(10, 20, AddIntCallBack, proxy);
                Console.WriteLine("AsyncAdd was called");

                Console.WriteLine("Call One Way Operation");
                proxy.OneWayOperation("one way");
                Console.WriteLine("One Way Operation was called");

                Console.WriteLine("Call Two Way Operation");
                proxy.TwoWayOperation("two way");
                Console.WriteLine("Two Way Operation was called");

                Console.ReadLine();
            }
        }
 static void Main(string[] args)
 {
     MyMathClient proxy = new MyMathClient();
     int res = proxy.Add(5, "+", 5);
     Console.WriteLine("Sum = {0}" , res);
     Console.WriteLine("Press Enter");
     Console.ReadLine();
 }
示例#4
0
        static void Main(string[] args)
        {
            MyMathClient client = new MyMathClient();
            client.Div(32, 0);

            Console.WriteLine("Press any key");
            Console.ReadLine();
        }
示例#5
0
        static void Main(string[] args)
        {
            MyMathClient proxy = new MyMathClient();

            int result = proxy.Add(35, 57);
            Console.WriteLine("Сумма = {0}", result);
            Console.WriteLine("Для завершения нажмите<ENTER>.\n\n");
            Console.ReadLine();
        }
示例#6
0
        static void Main(string[] args)
        {
            MyMathClient client = new MyMathClient();

            client.Div(32, 0);

            Console.WriteLine("Press any key");
            Console.ReadLine();
        }
        static void Main(string[] args)
        {
            MyMathClient proxy = new MyMathClient();
            IAsyncResult arAdd;

            arAdd = proxy.BeginTotal(100, 50, GetSumCallback, proxy);
            Console.WriteLine("Press Enter");
            Console.ReadLine();
        }
示例#8
0
        static void Main(string[] args)
        {
            MyMathClient proxy = new MyMathClient();

            MathResult mr = proxy.Total(35, 38);
            Console.WriteLine("Результат: {0} {1} {2} {3}", mr.sum, mr.subtr, mr.div, mr.mult);

            Console.WriteLine("Для завершения нажмите<ENTER>.\n\n");
            Console.ReadLine();
        }
示例#9
0
        static void Main(string[] args)
        {
            MyMathClient MathClient = new MyMathClient();

            int result = MathClient.Add(21, 13);

            Console.WriteLine("result: {0}", result);
            Console.WriteLine("Push any key for exit");
            Console.ReadKey();

            MathClient.Close();
        }
示例#10
0
        static void Main(string[] args)
        {
            MyMathClient MathClient = new MyMathClient();

            int result = MathClient.Add(21, 13);

            Console.WriteLine("result: {0}", result);
            Console.WriteLine("Push any key for exit");
            Console.ReadKey();

            MathClient.Close();
        }
示例#11
0
        static void Main(string[] args)
        {
            MyMathClient proxy = new MyMathClient();	//создаем объект прокси-класса
            IAsyncResult arAdd;	//готовим возвращаемое значение метода BeginTotal()

            //вызываем метод BeginTotal()
            //обратите внимание на 3-й и 4-й параметры:
            //GetSumCallback – адрес метода, который будет вызван по завершении //асинхронного вызова BeginTotal();
            //proxy – объект, передаваемый методу GetSumCallback()
            //через свойство AsyncState его параметра. Нам этот объект будет
            //нужем в методе GetSumCallback() для вызова EndTotal()

            arAdd = proxy.BeginTotal(100, 50, GetSumCallback, proxy);

            Console.WriteLine("Для завершения нажмите<ENTER>\n\n");
            Console.ReadLine();
        }
        static void Main(string[] args)
        {
            try
            {
                //ChannelFactory<IMyMath> factory = new ChannelFactory<IMyMath>(
                //    new WSHttpBinding(),
                //    new EndpointAddress("http://localhost/MathService/ep1")
                //    );
                //IMyMath channel = factory.CreateChannel();

                MyMathClient proxy = new MyMathClient();
                MathResult mr = proxy.Total(35, 48);

                Console.WriteLine("result: {0} {1} {2} {3}" , mr.sum , mr.subrt , mr.div , mr.mult);
                Console.WriteLine("Для завершения нажмите <ENTER>\n");
                Console.ReadLine();
                //factory.Close();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
示例#13
0
 static void Main(string[] args)
 {
     MyMathClient client = new MyMathClient();
     Console.WriteLine("res = " + client.Add(9, 1));
     Console.ReadLine();
 }