IncrementCounter() private method

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

            switch (frame.State) {
            case Initialized:
                frame.Counter = 0;
                frame.State   = Outputting;
                goto case Outputting;

            case Outputting:
                Debug.Assert(frame.State == Outputting);

                while (processor.CanContinue) {
                    Debug.Assert(frame.Counter < this.copyEvents.Count);
                    Event copyEvent = (Event) this.copyEvents[frame.Counter];

                    if (copyEvent.Output(processor, frame) == false) {
                        // This event wasn't processed
                        break;
                    }

                    if (frame.IncrementCounter() >= this.copyEvents.Count) {
                        frame.Finished();
                        break;
                    }
                }
                break;
            default:
                Debug.Fail("Invalid CopyCodeAction execution state");
                break;
            }
        }
        internal override void Execute(Processor processor, ActionFrame frame)
        {
            switch (frame.State)
            {
            case Initialized:
                frame.Counter = 0;
                frame.State   = ProcessingSets;
                goto case ProcessingSets;

            case ProcessingSets:
                if (frame.Counter < this.useAttributeSets.Length)
                {
                    AttributeSetAction action = processor.RootAction.GetAttributeSet(this.useAttributeSets[frame.Counter]);
                    frame.IncrementCounter();
                    processor.PushActionFrame(action, frame.NodeSet);
                }
                else
                {
                    frame.Finished();
                }
                break;

            default:
                Debug.Fail("Invalid Container action execution state");
                break;
            }
        }
Ejemplo n.º 3
0
        internal override void Execute(Processor processor, ActionFrame frame)
        {
            switch (frame.State)
            {
                case Initialized:
                    frame.Counter = 0;
                    frame.State = ProcessingSets;
                    goto case ProcessingSets;

                case ProcessingSets:
                    if (frame.Counter < _useAttributeSets.Length)
                    {
                        AttributeSetAction action = processor.RootAction.GetAttributeSet(_useAttributeSets[frame.Counter]);
                        frame.IncrementCounter();
                        processor.PushActionFrame(action, frame.NodeSet);
                    }
                    else
                    {
                        frame.Finished();
                    }
                    break;

                default:
                    Debug.Fail("Invalid Container action execution state");
                    break;
            }
        }
        internal override void Execute(Processor processor, ActionFrame frame)
        {
            switch (frame.State)
            {
            case Initialized:
                frame.Counter = 0;
                frame.State   = ProcessingSets;
                goto case ProcessingSets;

            case ProcessingSets:
                if (frame.Counter < _useAttributeSets !.Length)
                {
                    AttributeSetAction action = processor.RootAction !.GetAttributeSet(_useAttributeSets[frame.Counter]);
                    frame.IncrementCounter();
                    processor.PushActionFrame(action, frame.NodeSet);
                }
                else
                {
                    frame.Finished();
                }
                break;
Ejemplo n.º 5
0
        internal override void Execute(Processor processor, ActionFrame frame)
        {
            Debug.Assert(processor != null && frame != null);
            Debug.Assert(_copyEvents != null && _copyEvents.Count > 0);

            switch (frame.State)
            {
            case Initialized:
                frame.Counter = 0;
                frame.State   = Outputting;
                goto case Outputting;

            case Outputting:
                Debug.Assert(frame.State == Outputting);

                while (processor.CanContinue)
                {
                    Debug.Assert(frame.Counter < _copyEvents.Count);
                    Event copyEvent = (Event)_copyEvents[frame.Counter];

                    if (copyEvent.Output(processor, frame) == false)
                    {
                        // This event wasn't processed
                        break;
                    }

                    if (frame.IncrementCounter() >= _copyEvents.Count)
                    {
                        frame.Finished();
                        break;
                    }
                }
                break;

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