System.Xml.Xsl.IlGen.XmlILElementAnalyzer.AnalyzeAttributeCtor C# (CSharp) Method

AnalyzeAttributeCtor() private method

Analyze attribute constructor.
private AnalyzeAttributeCtor ( QilBinary ndAttr, XmlILConstructInfo info ) : void
ndAttr System.Xml.Xsl.Qil.QilBinary
info XmlILConstructInfo
return void
        private void AnalyzeAttributeCtor(QilBinary ndAttr, XmlILConstructInfo info) {
            if (ndAttr.Left.NodeType == QilNodeType.LiteralQName) {
                QilName ndName = ndAttr.Left as QilName;
                XmlQualifiedName qname;
                int idx;

                // This attribute might be constructed on the parent element
                this.parentInfo.MightHaveAttributes = true;

                // Check to see whether this attribute is a duplicate of a previous attribute
                if (!this.parentInfo.MightHaveDuplicateAttributes) {
                    qname = new XmlQualifiedName(this.attrNames.Add(ndName.LocalName), this.attrNames.Add(ndName.NamespaceUri));

                    for (idx = 0; idx < this.dupAttrs.Count; idx++) {
                        XmlQualifiedName qnameDup = (XmlQualifiedName) this.dupAttrs[idx];

                        if ((object) qnameDup.Name == (object) qname.Name && (object) qnameDup.Namespace == (object) qname.Namespace) {
                            // A duplicate attribute has been encountered
                            this.parentInfo.MightHaveDuplicateAttributes = true;
                        }
                    }

                    if (idx >= this.dupAttrs.Count) {
                        // This is not a duplicate attribute, so add it to the set
                        this.dupAttrs.Add(qname);
                    }
                }

                // The attribute's namespace might need to be declared
                if (!info.IsNamespaceInScope)
                    this.parentInfo.MightHaveNamespaces = true;
            }
            else {
                // Attribute prefix and namespace are not known at compile-time
                CheckAttributeNamespaceConstruct(ndAttr.XmlType);
            }
        }