Exit() private method

private Exit ( ) : void
return void
Ejemplo n.º 1
0
        internal override void Execute(Processor processor, ActionFrame frame) {
            Debug.Assert(processor != null && frame != null);

            switch (frame.State) {
            case Initialized:
                if (this.type == ConditionType.ConditionIf || this.type == ConditionType.ConditionWhen) {
                    Debug.Assert(this.testKey != Compiler.InvalidQueryKey);
                    bool value = processor.EvaluateBoolean(frame, this.testKey);
                    if (value == false) {
                        frame.Finished();
                        break;
                    }
                }

                processor.PushActionFrame(frame);
                frame.State = ProcessingChildren;
                break;                              // Allow children to run

            case ProcessingChildren:
                if (this.type == ConditionType.ConditionWhen ||this.type == ConditionType.ConditionOtherwise) {
                    Debug.Assert(frame.Container != null);
                    frame.Exit();
                }

                frame.Finished();
                break;

            default:
                Debug.Fail("Invalid IfAction execution state");
        		break;
            }
        }
Ejemplo n.º 2
0
        internal override void Execute(Processor processor, ActionFrame frame)
        {
            Debug.Assert(processor != null && frame != null);

            switch (frame.State)
            {
            case Initialized:
                if (_type == ConditionType.ConditionIf || _type == ConditionType.ConditionWhen)
                {
                    Debug.Assert(_testKey != Compiler.InvalidQueryKey);
                    bool value = processor.EvaluateBoolean(frame, _testKey);
                    if (value == false)
                    {
                        frame.Finished();
                        break;
                    }
                }

                processor.PushActionFrame(frame);
                frame.State = ProcessingChildren;
                break;                                  // Allow children to run

            case ProcessingChildren:
                if (_type == ConditionType.ConditionWhen || _type == ConditionType.ConditionOtherwise)
                {
                    Debug.Assert(frame.Container != null);
                    frame.Exit();
                }

                frame.Finished();
                break;

            default:
                Debug.Fail("Invalid IfAction execution state");
                break;
            }
        }