public void Add(string BtnStr) { ExprLegit = true; if (haveCounted) { haveCounted = false; ExprStr = ""; } char [] op = BtnStr.ToCharArray(); if (IsOP(op[0])) { if (ExprStr.EndsWith("+") || ExprStr.EndsWith("-") || ExprStr.EndsWith("×") || ExprStr.EndsWith("÷")) { ExprStr = ExprStr.Remove(ExprStr.Length - 1); } } if (BtnStr == "squa" || BtnStr == "cube" || BtnStr == "fact") { ExprStr = BtnStr + "(" + ExprStr + ")"; } else { ExprStr = ExprStr + BtnStr; } }
public void BackSpace() { int pos = ExprStr.Length - 1; if (pos >= 0) { ExprStr = ExprStr.Remove(pos); } }
public override bool Equals(object obj) { var other = obj as ExprDesc; if (other == null) { return(false); } return(ExprStr.Equals(other.ExprStr)); }
public override int GetHashCode() { return(ExprStr.GetHashCode()); }