/// <summary> /// Appends character depending on pressed button. /// </summary> private void AppendCharacter(object sender, RoutedEventArgs e) { if (operationExecutor.State == ExecutorState.OperatorGot) { inputValidator.ClearInput(); operationExecutor.State = ExecutorState.SecondOperandInput; } if (operationExecutor.State == ExecutorState.ResultCalculated || operationExecutor.State == ExecutorState.Error) { inputValidator.ClearInput(); SetSecondaryOutput(""); operationExecutor.Clear(); } string newText = inputValidator.Validate((sender as Button).Content.ToString()); SetMainOutput(newText); }