System.Xml.XmlSubtreeReader.Skip C# (CSharp) Méthode

Skip() public méthode

public Skip ( ) : void
Résultat void
        public override void Skip() {

            switch ( state ) {
                case State.Initial:
                    Read();
                    return;

                case State.Interactive:
                    curNsAttr = -1;
                    useCurNode = false;
                    reader.MoveToElement();
                    Debug.Assert( reader.Depth >= initialDepth );
                    if ( reader.Depth == initialDepth ) {
                        if ( reader.NodeType == XmlNodeType.Element && !reader.IsEmptyElement ) {
                            // we are on root of the subtree -> skip to the end element and set to Eof state
                            reader.Read();
                            while ( reader.NodeType != XmlNodeType.EndElement && reader.Depth > initialDepth ) {
                                reader.Skip();
                            }
                        }
                        Debug.Assert( reader.NodeType == XmlNodeType.EndElement || 
                                      reader.NodeType == XmlNodeType.Element && reader.IsEmptyElement );
                        state = State.EndOfFile;
                        SetEmptyNode();
                        return;
                    }

                    if ( reader.NodeType == XmlNodeType.Element && !reader.IsEmptyElement ) {
                        nsManager.PopScope();
                    }
                    reader.Skip();
                    ProcessNamespaces();

                    Debug.Assert( reader.Depth >= initialDepth );
                    return;

                case State.Closed:
                case State.EndOfFile:
                    return;

                case State.PopNamespaceScope:
                    nsManager.PopScope();
                    goto case State.ClearNsAttributes;

                case State.ClearNsAttributes:
                    nsAttrCount = 0;
                    state = State.Interactive;
                    goto case State.Interactive;

                case State.ReadElementContentAsBase64:
                case State.ReadElementContentAsBinHex:
                    if ( FinishReadElementContentAsBinary() ) {
                        Skip();
                    }
                    break;
                    
                case State.ReadContentAsBase64:
                case State.ReadContentAsBinHex:
                    if ( FinishReadContentAsBinary() ) {
                        Skip();
                    }
                    break;

                default:
                    Debug.Assert( false );
                    return;
            }
        }