Beispiel #1
0
 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;
     }
 }
Beispiel #2
0
        public void BackSpace()
        {
            int pos = ExprStr.Length - 1;

            if (pos >= 0)
            {
                ExprStr = ExprStr.Remove(pos);
            }
        }
Beispiel #3
0
        public override bool Equals(object obj)
        {
            var other = obj as ExprDesc;

            if (other == null)
            {
                return(false);
            }
            return(ExprStr.Equals(other.ExprStr));
        }
Beispiel #4
0
 public override int GetHashCode()
 {
     return(ExprStr.GetHashCode());
 }