/* Dodaje znak do dzialania */ public void AddSignToEquation(char Operator) { if (true == CurrentEquationState[CurrentEquationState.Length - 1].IsMathematicalOperator()) { CurrentEquationState = CurrentEquationState.Remove(CurrentEquationState.Length - 1, 1); } CurrentEquationState += Operator; ChangeWordButton(this, new MyEventArgs("false")); UpdateDisplay(this, eUpdateArgs); }
/* Usuwa ostatni wprowadzony znak */ public void DeleteLastSignInEquation() { if (CurrentEquationState != "0" && CurrentEquationState.Length > 1) { CurrentEquationState = CurrentEquationState.Remove(CurrentEquationState.Length - 1); } else if (CurrentEquationState != "0" && CurrentEquationState.Length == 1) { CurrentEquationState = "0"; } if (false == CurrentEquationState.IsThereAnyMathematicalOperatorInString()) { ChangeWordButton(this, new MyEventArgs("true")); } UpdateDisplay(this, eUpdateArgs); }