/// <summary>
 /// Creates an XmlAttribute with the specified Prefix, LocalName, and NamespaceURI.
 /// </summary>
 /// <param name="prefix">The prefix of the attribute (if any). String.Empty and a null reference (Nothing in Visual Basic) are equivalent.</param>
 /// <param name="localname">The local name of the attribute.</param>
 /// <param name="namespaceuri">The namespace URI of the attribute (if any). String.Empty and a null reference (Nothing in Visual Basic) are equivalent. If prefix is xmlns, then this parameter must be http://www.w3.org/2000/xmlns/; otherwise an exception is thrown.</param>
 /// <returns>The new XmlAttribute.</returns>
 public override XmlAttribute CreateAttribute(string prefix, string localname, string namespaceuri)
 {
     LineInfoAttribute attr = new LineInfoAttribute(prefix, localname, namespaceuri, this);
     IXmlLineInfo lineInfo = this.reader as IXmlLineInfo;
     if (lineInfo != null && lineInfo.HasLineInfo())
     {
         attr.SetLineInfo(lineInfo.LineNumber, lineInfo.LinePosition);
     }
     return attr;
 }
Esempio n. 2
0
        /// <summary>
        /// Creates an XmlAttribute with the specified Prefix, LocalName, and NamespaceURI.
        /// </summary>
        /// <param name="prefix">The prefix of the attribute (if any). String.Empty and a null reference (Nothing in Visual Basic) are equivalent.</param>
        /// <param name="localname">The local name of the attribute.</param>
        /// <param name="namespaceuri">The namespace URI of the attribute (if any). String.Empty and a null reference (Nothing in Visual Basic) are equivalent. If prefix is xmlns, then this parameter must be http://www.w3.org/2000/xmlns/; otherwise an exception is thrown.</param>
        /// <returns>The new XmlAttribute.</returns>
        public override XmlAttribute CreateAttribute(string prefix, string localname, string namespaceuri)
        {
            LineInfoAttribute attr     = new LineInfoAttribute(prefix, localname, namespaceuri, this);
            IXmlLineInfo      lineInfo = this.reader as IXmlLineInfo;

            if (lineInfo != null && lineInfo.HasLineInfo())
            {
                attr.SetLineInfo(lineInfo.LineNumber, lineInfo.LinePosition);
            }
            return(attr);
        }