private void btnMinus_Click(object sender, RoutedEventArgs e) { CheckOperation(); operationToDo = OpeartionType.SUBSTRACTION; lastOperationSign = OpeartoinSigns.SUBSTRACTION; lblHistory.Content = GenerateHistory(); }
//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; } }
private void btnSqrt_Click(object sender, RoutedEventArgs e) { CheckOperation(); lastOperationSign = OpeartoinSigns.SQUARE_ROOT; operationToDo = OpeartionType.SQUARE_ROOT; lblHistory.Content = GenerateHistory(); }
private void btnModulo_Click(object sender, RoutedEventArgs e) { CheckOperation(); operationToDo = OpeartionType.MODULO; lastOperationSign = OpeartoinSigns.MODULO; lblHistory.Content = GenerateHistory(); }
private void btnMultiply_Click(object sender, RoutedEventArgs e) { CheckOperation(); operationToDo = OpeartionType.MULTIPLICATION; lastOperationSign = OpeartoinSigns.MULTIPLICATION; lblHistory.Content = GenerateHistory(); }
private void btnDivide_Click(object sender, RoutedEventArgs e) { CheckOperation(); operationToDo = OpeartionType.DIVISION; lastOperationSign = OpeartoinSigns.DIVISION; lblHistory.Content = GenerateHistory(); }
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, OpeartionType operationType, ILogger logger) { this.ruleName = ruleName; this.operationType = operationType; this.logger = logger; }