示例#1
0
 public void OnClearEntry()
 {
     displayInvalid = true;
     decimalAdded   = false;
     negative       = NegState.Pos;
     blockZero      = ZeroState.None;
 }
示例#2
0
        private void OnOverwrite()
        {
            if (blockZero == ZeroState.Adding)
            {
                blockZero = ZeroState.BlockZero;
            }
            else if (negative == NegState.Negating)
            {
                blockZero = ZeroState.None;
            }

            if (negative == NegState.Negating || negative == NegState.Clearing)
            {
                displayInvalid = true;
                negative       = NegState.Neg;
            }
            else
            {
                displayInvalid = false;
                negative       = NegState.Pos;
            }

            if (state != State.NextOp && state != State.FirstOp)
            {
                CurrentOperation = Operation.Add;
                state            = State.Import;
            }
            else
            {
                state = State.Editing;
            }

            decimalAdded = false;
        }
示例#3
0
 public void OnClear()
 {
     state          = State.Reset;
     decimalAdded   = false;
     displayInvalid = false;
     negative       = NegState.Pos;
     blockZero      = ZeroState.None;
 }
示例#4
0
 public void OnOperation()
 {
     if (state == State.NoChain)
     {
         state = State.NextOp;
     }
     isEvaluate = false;
     blockZero  = ZeroState.None;
 }
示例#5
0
 public void OnEvaluate()
 {
     if (state == State.NextOp || state == State.FirstOp)
     {
         state = State.NoChain;
     }
     isEvaluate = true;
     blockZero  = ZeroState.None;
 }
示例#6
0
 public void OnNumber(int number)
 {
     displayInvalid = false;
     if (number == 0)
     {
         if (blockZero == ZeroState.None)
         {
             blockZero = ZeroState.Adding;
         }
         else if (blockZero == ZeroState.BlockZero)
         {
             blockZero = ZeroState.Blocking;
         }
     }
     else if (blockZero == ZeroState.BlockZero)
     {
         blockZero = ZeroState.Replacing;
     }
     else
     {
         blockZero = ZeroState.AcceptAll;
     }
 }
示例#7
0
 public void OnDecimalPost()
 {
     decimalAdded   = true;
     displayInvalid = false;
     blockZero      = ZeroState.AcceptAll;
 }