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

FinishReadElementContentAsBinary() private méthode

private FinishReadElementContentAsBinary ( ) : bool
Résultat bool
        private bool FinishReadElementContentAsBinary() {
            Debug.Assert( state == State.ReadElementContentAsBase64 || state == State.ReadElementContentAsBinHex );

            byte[] bytes = new byte[256];
            if ( state == State.ReadElementContentAsBase64 ) {
                while ( reader.ReadContentAsBase64( bytes, 0, 256 ) > 0 ) ;
            }
            else {
                while ( reader.ReadContentAsBinHex( bytes, 0, 256 ) > 0 ) ;
            }

            if ( NodeType != XmlNodeType.EndElement ) {
                throw new XmlException( Res.Xml_InvalidNodeType, reader.NodeType.ToString(), reader as IXmlLineInfo );
            }

            // pop namespace scope
            state = State.Interactive;
            ProcessNamespaces();

            // check eof
            if ( reader.Depth == initialDepth ) {
                 state = State.EndOfFile;
                 SetEmptyNode();
                 return false;
            }
            // move off end element
            return Read();
        }