System.Xml.Xsl.IlGen.XmlILVisitor.StartWriterLoop C# (CSharp) Method

StartWriterLoop() private method

Construction within a loop is starting. If transition from non-Any to Any state occurs, then ensure that runtime state will be set.
private StartWriterLoop ( QilNode nd, bool &hasOnEnd, Label &lblOnEnd ) : void
nd QilNode
hasOnEnd bool
lblOnEnd System.Reflection.Emit.Label
return void
        private void StartWriterLoop(QilNode nd, out bool hasOnEnd, out Label lblOnEnd) {
            XmlILConstructInfo info = XmlILConstructInfo.Read(nd);

            // By default, do not create a new iteration label
            hasOnEnd = false;
            lblOnEnd = new Label();

            // If loop is not involved in Xml construction, or if loop returns exactly one value, then do nothing
            if (!info.PushToWriterLast || nd.XmlType.IsSingleton)
                return;

            if (!this.iterCurr.HasLabelNext) {
                // Iterate until all items are constructed
                hasOnEnd = true;
                lblOnEnd = this.helper.DefineLabel();
                this.iterCurr.SetIterator(lblOnEnd, StorageDescriptor.None());
            }
        }
XmlILVisitor