System.Xml.Xsl.XsltOld.CopyCodeAction.Execute C# (CSharp) Method

Execute() private method

private Execute ( Processor processor, ActionFrame frame ) : void
processor Processor
frame ActionFrame
return void
        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;
            }
        }