System.Xml.XmlNodeReader.Read C# (CSharp) Méthode

Read() private méthode

private Read ( bool fSkipChildren ) : bool
fSkipChildren bool
Résultat bool
        private bool Read( bool fSkipChildren ) {
            if( fEOF )
                return false;

            if ( readState == ReadState.Initial ) {
                // if nav is pointing at the document node, start with its children
                // otherwise,start with the node.
                if ( ( readerNav.NodeType == XmlNodeType.Document ) || ( readerNav.NodeType == XmlNodeType.DocumentFragment ) ) {
                    bStartFromDocument = true;
                    if ( !ReadNextNode(fSkipChildren) ) {
                        readState = ReadState.Error;
                        return false;
                    }
                }
                ReSetReadingMarks();
                readState = ReadState.Interactive;
                nodeType = readerNav.NodeType;
                //_depth = 0;
                curDepth = 0;
                return true;
            }

            if ( bInReadBinary ) {
                FinishReadBinary();
            }

            bool bRead = false;
            if( ( readerNav.CreatedOnAttribute ) )
                return false;
            ReSetReadingMarks();
            bRead = ReadNextNode(fSkipChildren);
            if ( bRead ) {
                return true;
            } else {
                if ( readState == ReadState.Initial || readState == ReadState.Interactive )
                    readState = ReadState.Error;
                if ( readState == ReadState.EndOfFile )
                    nodeType = XmlNodeType.None;
                return false;
            }
        }

Same methods

XmlNodeReader::Read ( ) : bool

Usage Example

        private void process_constants( XmlNodeReader nodeReader, CompleteTemplate ThisCompleteTemplate )
        {
            // Read all the nodes
            while ( nodeReader.Read() )
            {
                // Get the node name, trimmed and to upper
                string nodeName = nodeReader.Name.Trim().ToUpper();

                // If this is the inputs or constant start tag, return
                if (( nodeReader.NodeType == XmlNodeType.EndElement ) && ( nodeName == "CONSTANTS" ))
                {
                    return;
                }

                // If this is the beginning tag for an element, assign the next values accordingly
                if (( nodeReader.NodeType == XmlNodeType.Element ) && ( nodeName == "ELEMENT" ) && ( nodeReader.HasAttributes ))
                {
                    abstract_Element newConstant = process_element( nodeReader, -1 );
                    if (newConstant != null)
                    {
                        newConstant.isConstant = true;
                        ThisCompleteTemplate.Add_Constant(newConstant);
                    }
                }
            }
        }
All Usage Examples Of System.Xml.XmlNodeReader::Read