public void AddOperation(CalculatorOperation op) { countAfterPoint = 1; isPoint = false; if (LeftValue == null) { LeftValue = 0; } if (Operation != null) { if (RightValue != 0) { Compute(); } } else { LeftValue = RightValue; OnDidChangeLeft?.Invoke(this, new CalculatorEventArgs("Left change", LeftValue, RightValue, Operation)); } Operation = op; RightValue = null; OnDidChangeOperation?.Invoke(this, new CalculatorEventArgs("Change operation", LeftValue, RightValue, Operation)); }
public void AddOperation(CalculatorOperation op) { if (Operation != null) { Compute(); } else { LeftValue = RightValue; OnDidChangeLeft?.Invoke(this, new CalculatorEventArgs("Left change", LeftValue, RightValue, Operation)); } Operation = op; OnDidChangeOperation?.Invoke(this, new CalculatorEventArgs("Change operation", LeftValue, RightValue, Operation)); RightValue = null; }