This repository was archived by the owner on Apr 20, 2018. It is now read-only.
forked from microsoft/Tx
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathProgram.cs
More file actions
54 lines (48 loc) · 1.96 KB
/
Program.cs
File metadata and controls
54 lines (48 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
namespace WCFClient
{
using System;
class Program
{
static void Main(string[] args)
{
var calculatorClient = new CalculatorClient();
var operation = args[0];
var number1 = int.Parse(args[1]);
var number2 = int.Parse(args[2]);
if (string.Equals(operation, "-Add", StringComparison.OrdinalIgnoreCase))
{
var resultAdd = calculatorClient.Add(number1, number2);
Console.WriteLine("resultAdd: {0}", resultAdd);
}
else if (string.Equals(operation, "-Subtract", StringComparison.OrdinalIgnoreCase))
{
var resultSubtract = calculatorClient.Subtract(number1, number2);
Console.WriteLine("resultSubtract: {0}", resultSubtract);
}
else if (string.Equals(operation, "-Multiply", StringComparison.OrdinalIgnoreCase))
{
var resultMultiply = calculatorClient.Multiply(number1, number2);
Console.WriteLine("resultMultiply: {0}", resultMultiply);
}
else if (string.Equals(operation, "-Divide", StringComparison.OrdinalIgnoreCase))
{
var resultDivide = calculatorClient.Divide(number1, number2);
Console.WriteLine("resultDivide: {0}", resultDivide);
}
else if (string.Equals(operation, "-PowerOf", StringComparison.OrdinalIgnoreCase))
{
var resultPowerOf = calculatorClient.PowerOf(number1, number2);
Console.WriteLine("resultPowerOf: {0}", resultPowerOf);
}
else
{
Console.WriteLine("Invalid operation entered");
throw new ArgumentException("Invalid operation entered");
}
calculatorClient.Close();
// Console.WriteLine("Press <ENTER> to stop client");
// Console.ReadLine();
}
}
}