static void Main(string[] args) { Ifactory operFactory = new AddFactory(); Operation oper = operFactory.CreateOperation(); oper.NumberA = 1; oper.NumberB = 2; double result = oper.GetResult(); }
public static void Main(string[] args) { IFactory factory = new AddFactory(); Console.WriteLine("Add:" + factory.createOperator().getResult(3, 4)); Console.WriteLine(":" + getResultWithType(2, "Add", 8)); Console.WriteLine(":" + getResultWithType(10, "Sub", 1)); }
static void Main(string[] args) { IFactory factory = new AddFactory(); Operation oper = factory.CreateOperation(); oper.NumberA = 1; oper.NumberB = 2; double result = oper.GetResult(); Console.WriteLine(result); Console.ReadKey(); }