Exemplo n.º 1
0
 static void Main(string[] args)
 {
     AdditionServiceClient client = new AdditionServiceClient();
     Complex c1 = new Complex(), c2 = new Complex();
     c1.real = 3; c1.imag = 5;
     c2.real = 1; c2.imag = 7;
     Complex result = client.Add(c1, c2);
 }
Exemplo n.º 2
0
        private static void Main(string[] args)
        {
            var service = new AdditionServiceClient();

            Console.WriteLine("Starting");
            while (true)
            {
                string value = Console.ReadLine();
                service.AddNumbersAsync(value.ConvertToDecimalList().ToList()).ToObservable()
                       .Subscribe(x => Console.WriteLine(string.Format("Sum of {0} is {1}", value, x)));
            }
        }
Exemplo n.º 3
0
        private static void Main(string[] args)
        {
            var additionServiceClient = new AdditionServiceClient();

            Console.WriteLine("Starting");
            while (true)
            {
                string value = Console.ReadLine();
                var serviceFuntion = Observable.FromAsyncPattern<List<decimal>, decimal>(additionServiceClient.BeginAddNumbers,
                                                                        additionServiceClient.EndAddNumbers);
                serviceFuntion(value.ConvertToDecimalList().ToList())
                      .Subscribe(x => Console.WriteLine("Sum of {0} is {1}", value, x));
            }
        }