Esempio n. 1
0
        public static double Add()
        {
            double           operand1    = ReciveOperands("Operand1");
            double           operand2    = ReciveOperands("Operand2");
            OperatorsFactory addFactory  = new AddFactory();
            Operator         addOperator = addFactory.Create();

            return(addOperator.Calculate(operand1, operand2));
        }
Esempio n. 2
0
 protected override void CustomProcessRequest(HttpContext context)
 {
     try
     {
         AddFactory   factory     = new AddFactory(context);
         IAddBehavior addBehavior = factory.Create();
         addBehavior.Add();
     }
     catch (Exception ex)
     {
         ContextHelper contextHelper = new ContextHelper(context);
         contextHelper.ResponseError(ex.Message);
     }
 }