static XmlSqlBinaryReader()
 {
     System.Xml.ReadState[] stateArray = new System.Xml.ReadState[9];
     stateArray[0] = System.Xml.ReadState.Interactive;
     stateArray[1] = System.Xml.ReadState.Interactive;
     stateArray[2] = System.Xml.ReadState.Interactive;
     stateArray[3] = System.Xml.ReadState.Interactive;
     stateArray[4] = System.Xml.ReadState.Interactive;
     stateArray[6] = System.Xml.ReadState.Error;
     stateArray[7] = System.Xml.ReadState.EndOfFile;
     stateArray[8] = System.Xml.ReadState.Closed;
     ScanState2ReadState = stateArray;
 }
 public XmlNodeReader(XmlNode node)
 {
     if (node == null)
     {
         throw new ArgumentNullException("node");
     }
     this.readerNav          = new XmlNodeReaderNavigator(node);
     this.curDepth           = 0;
     this.readState          = System.Xml.ReadState.Initial;
     this.fEOF               = false;
     this.nodeType           = XmlNodeType.None;
     this.bResolveEntity     = false;
     this.bStartFromDocument = false;
 }
 private bool Read(bool fSkipChildren)
 {
     if (!this.fEOF)
     {
         if (this.readState == System.Xml.ReadState.Initial)
         {
             if ((this.readerNav.NodeType == XmlNodeType.Document) || (this.readerNav.NodeType == XmlNodeType.DocumentFragment))
             {
                 this.bStartFromDocument = true;
                 if (!this.ReadNextNode(fSkipChildren))
                 {
                     this.readState = System.Xml.ReadState.Error;
                     return(false);
                 }
             }
             this.ReSetReadingMarks();
             this.readState = System.Xml.ReadState.Interactive;
             this.nodeType  = this.readerNav.NodeType;
             this.curDepth  = 0;
             return(true);
         }
         if (this.bInReadBinary)
         {
             this.FinishReadBinary();
         }
         if (!this.readerNav.CreatedOnAttribute)
         {
             this.ReSetReadingMarks();
             if (this.ReadNextNode(fSkipChildren))
             {
                 return(true);
             }
             if ((this.readState == System.Xml.ReadState.Initial) || (this.readState == System.Xml.ReadState.Interactive))
             {
                 this.readState = System.Xml.ReadState.Error;
             }
             if (this.readState == System.Xml.ReadState.EndOfFile)
             {
                 this.nodeType = XmlNodeType.None;
             }
         }
     }
     return(false);
 }
 private void SetEndOfFile()
 {
     this.fEOF      = true;
     this.readState = System.Xml.ReadState.EndOfFile;
     this.nodeType  = XmlNodeType.None;
 }
 public override void Close()
 {
     this.readState = System.Xml.ReadState.Closed;
 }
            public override bool Read()
            {
                bool flag = true;
                switch (this.readState)
                {
                    case System.Xml.ReadState.Initial:
                        this.readState = System.Xml.ReadState.Interactive;
                        this.nodeType = XmlNodeType.Text;
                        break;

                    case System.Xml.ReadState.Interactive:
                        if (!this.finishedStream && ((this.bytesRemaining != this.chunkSize) || (this.stringValue != null)))
                        {
                            this.bytesRemaining = this.chunkSize;
                            break;
                        }
                        this.readState = System.Xml.ReadState.EndOfFile;
                        this.nodeType = XmlNodeType.EndElement;
                        break;

                    case System.Xml.ReadState.EndOfFile:
                        this.nodeType = XmlNodeType.None;
                        flag = false;
                        break;
                }
                this.stringValue = null;
                this.binHexStream = null;
                this.valueOffset = 0;
                this.valueCount = 0;
                this.stringOffset = 0;
                this.CloseStreams();
                return flag;
            }
 public override void Close()
 {
     this.CloseStreams();
     this.readState = System.Xml.ReadState.Closed;
 }
 public XopIncludeReader(XmlMtomReader.MimePart part, XmlDictionaryReader reader)
 {
     if (part == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("part");
     }
     if (reader == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("reader");
     }
     this.part = part;
     this.parentReader = reader;
     this.readState = System.Xml.ReadState.Initial;
     this.nodeType = XmlNodeType.None;
     this.chunkSize = Math.Min(reader.Quotas.MaxBytesPerRead, this.chunkSize);
     this.bytesRemaining = this.chunkSize;
     this.finishedStream = false;
 }