예제 #1
0
 /// <summary>
 /// Tries to add A new MathItem to the exsisting problem
 /// </summary>
 /// <param name="newMathItem"></param>
 /// <returns></returns>
 private bool tryToAddNewMathItem(MathItem newMathItem)
 {
     if (newMathItem is MathValue)
     {
         return(TrytoAddnewValueItem(newMathItem as MathValue));
     }
     else
     {
         return(TrytoAddnewOperatorItem(newMathItem as MathOperator));
     }
 }
예제 #2
0
 public bool AddToProblem(MathItem newMathItem)
 {
     if (Problem == null)
     {
         Problem = new List <MathItem>();
         Problem.Add(newMathItem);
         return(true);
     }
     else
     {
         return(tryToAddNewMathItem(newMathItem));
     }
 }