IsTextualNode() static private method

static private IsTextualNode ( System.Xml.XmlNodeType nodeType ) : bool
nodeType System.Xml.XmlNodeType
return bool
Esempio n. 1
0
        public virtual string ReadString()
        {
            if (this.ReadState != ReadState.Interactive)
            {
                return("");
            }
            this.MoveToElement();
            if (this.NodeType == XmlNodeType.Element)
            {
                if (this.IsEmptyElement)
                {
                    return("");
                }
                if (!this.Read())
                {
                    throw new InvalidOperationException(Res.GetString(2));
                }
                if (this.NodeType == XmlNodeType.EndElement)
                {
                    return("");
                }
            }
            string str = "";

            while (XmlReader.IsTextualNode(this.NodeType))
            {
                str += this.Value;
                if (!this.Read())
                {
                    throw new InvalidOperationException(Res.GetString(2));
                }
            }
            return(str);
        }