Example #1
0
        public void StateButtonClicked(CalcState calcState)
        {
            switch (calcState)
            {
            case CalcState.PROG:
                Framework.SavedProgram = Framework.CurrentInput;
                Framework.CurrentInput = "";
                Framework.CurrentState = new CalculationState(Framework);
                Framework.TriggerRefreshUI("Changed to Calculation State");
                break;

            case CalcState.EXE:
                Framework.SavedProgram = Framework.CurrentInput;
                Framework.CurrentInput = "";
                var transitState = new ExeState(Framework);
                break;

            default:
                Framework.TriggerRefreshUI("Click PROG to leave this state");
                break;
            }
        }
Example #2
0
        public void StateButtonClicked(CalcState calcState)
        {
            switch (calcState)
            {
            case CalcState.STO:
                if (Framework.CurrentInput != "" && Framework.CurrentInput != ".")
                {
                    Framework.CurrentState = new StorageState(Framework);
                    Framework.TriggerRefreshUI("Changed to Storage State");
                }
                else
                {
                    Framework.TriggerRefreshUI("Enter operand than press STO");
                }
                break;

            case CalcState.RCL:
                Framework.CurrentState = new RecallState(Framework);
                Framework.TriggerRefreshUI("Changed to Recall State");
                break;

            case CalcState.PROG:
                Framework.CurrentState = new ProgState(Framework);
                Framework.TriggerRefreshUI("Changed to Prog State.. Enter 20 steps long instruction");
                break;

            case CalcState.EXE:
                if (Framework.SavedProgram != "")
                {
                    var transientState = new ExeState(Framework);
                }
                else
                {
                    Framework.TriggerRefreshUI("First enter Prog than use Exe");
                }
                break;
            }
        }