예제 #1
0
 private void btnMinus_Click(object sender, RoutedEventArgs e)
 {
     CheckOperation();
     operationToDo      = OpeartionType.SUBSTRACTION;
     lastOperationSign  = OpeartoinSigns.SUBSTRACTION;
     lblHistory.Content = GenerateHistory();
 }
예제 #2
0
        //end operation buttons

        private void DoOperation(OpeartionType ot)
        {
            switch (operationToDo)
            {
            case OpeartionType.ADDITION:
                lastValue = lastValue + GetValueFromTextBox();
                break;

            case OpeartionType.SUBSTRACTION:
                lastValue = lastValue - GetValueFromTextBox();
                break;

            case OpeartionType.MULTIPLICATION:
                lastValue = lastValue * GetValueFromTextBox();
                break;

            case OpeartionType.DIVISION:
                lastValue = lastValue / GetValueFromTextBox();
                break;

            case OpeartionType.MODULO:
                lastValue = lastValue % GetValueFromTextBox();
                break;

            case OpeartionType.SQUARE_ROOT:
                lastValue = Math.Sqrt(GetValueFromTextBox());
                break;
            }
        }
예제 #3
0
 private void btnSqrt_Click(object sender, RoutedEventArgs e)
 {
     CheckOperation();
     lastOperationSign  = OpeartoinSigns.SQUARE_ROOT;
     operationToDo      = OpeartionType.SQUARE_ROOT;
     lblHistory.Content = GenerateHistory();
 }
예제 #4
0
 private void btnModulo_Click(object sender, RoutedEventArgs e)
 {
     CheckOperation();
     operationToDo      = OpeartionType.MODULO;
     lastOperationSign  = OpeartoinSigns.MODULO;
     lblHistory.Content = GenerateHistory();
 }
예제 #5
0
 private void btnMultiply_Click(object sender, RoutedEventArgs e)
 {
     CheckOperation();
     operationToDo      = OpeartionType.MULTIPLICATION;
     lastOperationSign  = OpeartoinSigns.MULTIPLICATION;
     lblHistory.Content = GenerateHistory();
 }
예제 #6
0
 private void btnDivide_Click(object sender, RoutedEventArgs e)
 {
     CheckOperation();
     operationToDo      = OpeartionType.DIVISION;
     lastOperationSign  = OpeartoinSigns.DIVISION;
     lblHistory.Content = GenerateHistory();
 }
예제 #7
0
        private double Calculate(OpeartionType ot, double firstOperand, double secondOperand)
        {
            double result = 0;

            switch (ot)
            {
            case OpeartionType.ADDITION:
                result = firstOperand + secondOperand;
                break;

            case OpeartionType.SUBSTRACTION:
                result = firstOperand - secondOperand;
                break;

            case OpeartionType.MULTIPLICATION:
                result = firstOperand * secondOperand;
                break;

            case OpeartionType.DIVISION:
                result = firstOperand / secondOperand;
                break;

            case OpeartionType.MODULO:
                result = firstOperand % secondOperand;
                break;

            case OpeartionType.SQUARE_ROOT:
                result = Math.Sqrt(firstOperand);
                break;
            }

            return(result);
        }
 public MockResponseRules(String ruleName, String apiPattern, OpeartionType operationType,
                          APIPatternType patternType, ILogger logger, IMockResponseCallback responseCallback)
 {
     this.ruleName         = ruleName;
     this.apiPattern       = apiPattern;
     this.operationType    = operationType;
     this.apiPattern       = apiPattern;
     this.patternType      = patternType;
     this.logger           = logger;
     this.responseCallback = responseCallback;
 }
 public MockResponseRules(String ruleName, String apiPattern, OpeartionType operationType,
     APIPatternType patternType, ILogger logger, IMockResponseCallback responseCallback)
 {
     this.ruleName = ruleName;
     this.apiPattern = apiPattern;
     this.operationType = operationType;
     this.apiPattern = apiPattern;
     this.patternType = patternType;
     this.logger = logger;
     this.responseCallback = responseCallback;
 }
 public MockResponseRules(String ruleName, OpeartionType operationType, ILogger logger)
 {
     this.ruleName      = ruleName;
     this.operationType = operationType;
     this.logger        = logger;
 }
 public MockResponseRules(String ruleName, OpeartionType operationType, ILogger logger)
 {
     this.ruleName = ruleName;
     this.operationType = operationType;
     this.logger = logger;
 }