DataSourceXmlTextReader.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / System / data / design / DataSourceXmlTextReader.cs / 1 / DataSourceXmlTextReader.cs

                            //------------------------------------------------------------------------------
// 
//    Copyright (c) Microsoft Corporation. All Rights Reserved.
//    Information Contained Herein is Proprietary and Confidential. 
// 
//----------------------------------------------------------------------------- 
 
namespace System.Data.Design {
 
    using System;
    using System.Collections;
    using System.IO;
    using System.Text; 

    using System.Xml; 
    using System.Xml.Schema; 

    internal class DataSourceXmlTextReader : XmlTextReader { 
        private DesignDataSource    dataSource;
        private bool                readingDataSource;

        internal DataSourceXmlTextReader(DesignDataSource dataSource, TextReader textReader) : base(textReader) { 
            this.dataSource = dataSource;
            this.readingDataSource = false; 
        } 

        internal DataSourceXmlTextReader(DesignDataSource dataSource, Stream stream) : base(stream) { 
            this.dataSource = dataSource;
            this.readingDataSource = false;
        }
 
        public override bool Read() {
            bool result = base.Read(); 
 
            if (result && !readingDataSource) {
                if (NodeType == XmlNodeType.Element) { 
                    if (LocalName == SchemaName.DataSourceRoot && NamespaceURI == SchemaName.DataSourceNamespace) {
                        readingDataSource = true;
                        dataSource.ReadDataSourceExtraInformation(this);
                        result = !EOF; 
                    }
                } 
            } 
            return result;
        } 
    }
}


// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK