System.Xml.XmlTextReaderImpl.MoveToAttribute C# (CSharp) Méthode

MoveToAttribute() public méthode

public MoveToAttribute ( int i ) : void
i int
Résultat void
        public override void MoveToAttribute(int i)
        {
            if (i < 0 || i >= _attrCount)
            {
                throw new ArgumentOutOfRangeException(nameof(i));
            }

            if (InAttributeValueIterator)
            {
                FinishAttributeValueIterator();
            }
            _curAttrIndex = i;
            _curNode = _nodes[_index + 1 + _curAttrIndex];
        }

Same methods

XmlTextReaderImpl::MoveToAttribute ( string name ) : bool
XmlTextReaderImpl::MoveToAttribute ( string localName, string namespaceURI ) : bool

Usage Example

Exemple #1
0
#pragma warning restore 618

        internal static void ParseXmlDeclarationValue(string strValue, out string version, out string encoding, out string standalone)
        {
            version    = null;
            encoding   = null;
            standalone = null;
            XmlTextReaderImpl tempreader = new XmlTextReaderImpl(strValue, (XmlParserContext)null);

            try
            {
                tempreader.Read();
                //get version info.
                if (tempreader.MoveToAttribute(nameof(version)))
                {
                    version = tempreader.Value;
                }
                //get encoding info
                if (tempreader.MoveToAttribute(nameof(encoding)))
                {
                    encoding = tempreader.Value;
                }
                //get standalone info
                if (tempreader.MoveToAttribute(nameof(standalone)))
                {
                    standalone = tempreader.Value;
                }
            }
            finally
            {
                tempreader.Close();
            }
        }
All Usage Examples Of System.Xml.XmlTextReaderImpl::MoveToAttribute
XmlTextReaderImpl