Ejemplo n.º 1
0
        private bool IsOperator(ECValues ecValue)
        {
            if (ecValue.Equals(ECValues.Addition))
            {
                return(true);
            }

            if (ecValue.Equals(ECValues.Subtraction))
            {
                return(true);
            }

            return(false);
        }
Ejemplo n.º 2
0
        public void InsertEcValue(ECValues currEcValue)
        {
            if (gExpectOperator)
            {
                if (IsOperator(currEcValue))
                {
                    goto Append;
                }

                gUserInputList[gUserInputList.Count - 1] = currEcValue;
                return;
            }

            //
            // We're not expecting an operator. Carry on!
            //

            if (gUserInputList.Count == 0)
            {
                if (IsOperator(currEcValue))
                {
                    return;
                }

                goto Append;
            }

            if (IsOperator(currEcValue))
            {
                gUserInputList[gUserInputList.Count - 1] = currEcValue;
                return;
            }

Append:
            gUserInputList.Add(currEcValue);
            gExpectOperator = !gExpectOperator;
        }
 public void InsertEcValue(ECValues ecValue)
 {
     gEcCpu.InsertEcValue(ecValue);
     gLabel.Text = gEcCpu.ExtractCurrentOutput();
 }