XmlNodeWriter.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / Serialization / System / Xml / XmlNodeWriter.cs / 1305376 / XmlNodeWriter.cs

                            //------------------------------------------------------------ 
// Copyright (c) Microsoft Corporation.  All rights reserved.
//-----------------------------------------------------------
namespace System.Xml
{ 
    using System.IO;
    using System.Collections; 
    using System.Text; 
    using System.Diagnostics;
    using System.Globalization; 
    using System.Runtime.Serialization;
    using System.Collections.Generic;

    abstract class XmlNodeWriter 
    {
        static XmlNodeWriter nullNodeWriter; 
 
        static public XmlNodeWriter Null
        { 
            get
            {
                if (nullNodeWriter == null)
                    nullNodeWriter = new XmlNullNodeWriter(); 
                return nullNodeWriter;
            } 
        } 

        public abstract void Flush(); 
        public abstract void Close();
        public abstract void WriteDeclaration();
        public abstract void WriteComment(string text);
        public abstract void WriteCData(string text); 
        public abstract void WriteStartElement(string prefix, string localName);
        public virtual void WriteStartElement(byte[] prefixBuffer, int prefixOffset, int prefixLength, byte[] localNameBuffer, int localNameOffset, int localNameLength) 
        { 
            WriteStartElement(Encoding.UTF8.GetString(prefixBuffer, prefixOffset, prefixLength), Encoding.UTF8.GetString(localNameBuffer, localNameOffset, localNameLength));
        } 
        public abstract void WriteStartElement(string prefix, XmlDictionaryString localName);
        public abstract void WriteEndStartElement(bool isEmpty);
        public abstract void WriteEndElement(string prefix, string localName);
        public virtual void WriteEndElement(byte[] prefixBuffer, int prefixOffset, int prefixLength, byte[] localNameBuffer, int localNameOffset, int localNameLength) 
        {
            WriteEndElement(Encoding.UTF8.GetString(prefixBuffer, prefixOffset, prefixLength), Encoding.UTF8.GetString(localNameBuffer, localNameOffset, localNameLength)); 
        } 
        public abstract void WriteXmlnsAttribute(string prefix, string ns);
        public virtual void WriteXmlnsAttribute(byte[] prefixBuffer, int prefixOffset, int prefixLength, byte[] nsBuffer, int nsOffset, int nsLength) 
        {
            WriteXmlnsAttribute(Encoding.UTF8.GetString(prefixBuffer, prefixOffset, prefixLength), Encoding.UTF8.GetString(nsBuffer, nsOffset, nsLength));
        }
        public abstract void WriteXmlnsAttribute(string prefix, XmlDictionaryString ns); 
        public abstract void WriteStartAttribute(string prefix, string localName);
        public virtual void WriteStartAttribute(byte[] prefixBuffer, int prefixOffset, int prefixLength, byte[] localNameBuffer, int localNameOffset, int localNameLength) 
        { 
            WriteStartAttribute(Encoding.UTF8.GetString(prefixBuffer, prefixOffset, prefixLength), Encoding.UTF8.GetString(localNameBuffer, localNameOffset, localNameLength));
        } 
        public abstract void WriteStartAttribute(string prefix, XmlDictionaryString localName);
        public abstract void WriteEndAttribute();
        public abstract void WriteCharEntity(int ch);
        public abstract void WriteEscapedText(string value); 
        public abstract void WriteEscapedText(XmlDictionaryString value);
        public abstract void WriteEscapedText(char[] chars, int offset, int count); 
        public abstract void WriteEscapedText(byte[] buffer, int offset, int count); 
        public abstract void WriteText(string value);
        public abstract void WriteText(XmlDictionaryString value); 
        public abstract void WriteText(char[] chars, int offset, int count);
        public abstract void WriteText(byte[] buffer, int offset, int count);
        public abstract void WriteInt32Text(int value);
        public abstract void WriteInt64Text(Int64 value); 
        public abstract void WriteBoolText(bool value);
        public abstract void WriteUInt64Text(UInt64 value); 
        public abstract void WriteFloatText(float value); 
        public abstract void WriteDoubleText(double value);
        public abstract void WriteDecimalText(decimal value); 
        public abstract void WriteDateTimeText(DateTime value);
        public abstract void WriteUniqueIdText(UniqueId value);
        public abstract void WriteTimeSpanText(TimeSpan value);
        public abstract void WriteGuidText(Guid value); 
        public abstract void WriteStartListText();
        public abstract void WriteListSeparator(); 
        public abstract void WriteEndListText(); 
        public abstract void WriteBase64Text(byte[] trailBuffer, int trailCount, byte[] buffer, int offset, int count);
        public abstract void WriteQualifiedName(string prefix, XmlDictionaryString localName); 

        class XmlNullNodeWriter : XmlNodeWriter
        {
            public override void Flush() {} 
            public override void Close() {}
            public override void WriteDeclaration() {} 
            public override void WriteComment(string text) {} 
            public override void WriteCData(string text) {}
            public override void WriteStartElement(string prefix, string localName) {} 
            public override void WriteStartElement(byte[] prefixBuffer, int prefixOffset, int prefixLength, byte[] localNameBuffer, int localNameOffset, int localNameLength) {}
            public override void WriteStartElement(string prefix, XmlDictionaryString localName) {}
            public override void WriteEndStartElement(bool isEmpty) {}
            public override void WriteEndElement(string prefix, string localName) {} 
            public override void WriteEndElement(byte[] prefixBuffer, int prefixOffset, int prefixLength, byte[] localNameBuffer, int localNameOffset, int localNameLength) { }
            public override void WriteXmlnsAttribute(string prefix, string ns) {} 
            public override void WriteXmlnsAttribute(byte[] prefixBuffer, int prefixOffset, int prefixLength, byte[] nsBuffer, int nsOffset, int nsLength) { } 
            public override void WriteXmlnsAttribute(string prefix, XmlDictionaryString ns) {}
            public override void WriteStartAttribute(string prefix, string localName) {} 
            public override void WriteStartAttribute(byte[] prefixBuffer, int prefixOffset, int prefixLength, byte[] localNameBuffer, int localNameOffset, int localNameLength) { }
            public override void WriteStartAttribute(string prefix, XmlDictionaryString localName) {}
            public override void WriteEndAttribute() {}
            public override void WriteCharEntity(int ch) {} 
            public override void WriteEscapedText(string value) {}
            public override void WriteEscapedText(XmlDictionaryString value) {} 
            public override void WriteEscapedText(char[] chars, int offset, int count) {} 
            public override void WriteEscapedText(byte[] buffer, int offset, int count) {}
            public override void WriteText(string value) {} 
            public override void WriteText(XmlDictionaryString value) {}
            public override void WriteText(char[] chars, int offset, int count) {}
            public override void WriteText(byte[] buffer, int offset, int count) {}
            public override void WriteInt32Text(int value) {} 
            public override void WriteInt64Text(Int64 value) {}
            public override void WriteBoolText(bool value) {} 
            public override void WriteUInt64Text(UInt64 value) {} 
            public override void WriteFloatText(float value) {}
            public override void WriteDoubleText(double value) {} 
            public override void WriteDecimalText(decimal value) {}
            public override void WriteDateTimeText(DateTime value) {}
            public override void WriteUniqueIdText(UniqueId value) {}
            public override void WriteTimeSpanText(TimeSpan value) {} 
            public override void WriteGuidText(Guid value) {}
            public override void WriteStartListText() {} 
            public override void WriteListSeparator() {} 
            public override void WriteEndListText() {}
            public override void WriteBase64Text(byte[] trailBuffer, int trailCount, byte[] buffer, int offset, int count) {} 
            public override void WriteQualifiedName(string prefix, XmlDictionaryString localName) {}
        }
    }
} 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------ 
// Copyright (c) Microsoft Corporation.  All rights reserved.
//-----------------------------------------------------------
namespace System.Xml
{ 
    using System.IO;
    using System.Collections; 
    using System.Text; 
    using System.Diagnostics;
    using System.Globalization; 
    using System.Runtime.Serialization;
    using System.Collections.Generic;

    abstract class XmlNodeWriter 
    {
        static XmlNodeWriter nullNodeWriter; 
 
        static public XmlNodeWriter Null
        { 
            get
            {
                if (nullNodeWriter == null)
                    nullNodeWriter = new XmlNullNodeWriter(); 
                return nullNodeWriter;
            } 
        } 

        public abstract void Flush(); 
        public abstract void Close();
        public abstract void WriteDeclaration();
        public abstract void WriteComment(string text);
        public abstract void WriteCData(string text); 
        public abstract void WriteStartElement(string prefix, string localName);
        public virtual void WriteStartElement(byte[] prefixBuffer, int prefixOffset, int prefixLength, byte[] localNameBuffer, int localNameOffset, int localNameLength) 
        { 
            WriteStartElement(Encoding.UTF8.GetString(prefixBuffer, prefixOffset, prefixLength), Encoding.UTF8.GetString(localNameBuffer, localNameOffset, localNameLength));
        } 
        public abstract void WriteStartElement(string prefix, XmlDictionaryString localName);
        public abstract void WriteEndStartElement(bool isEmpty);
        public abstract void WriteEndElement(string prefix, string localName);
        public virtual void WriteEndElement(byte[] prefixBuffer, int prefixOffset, int prefixLength, byte[] localNameBuffer, int localNameOffset, int localNameLength) 
        {
            WriteEndElement(Encoding.UTF8.GetString(prefixBuffer, prefixOffset, prefixLength), Encoding.UTF8.GetString(localNameBuffer, localNameOffset, localNameLength)); 
        } 
        public abstract void WriteXmlnsAttribute(string prefix, string ns);
        public virtual void WriteXmlnsAttribute(byte[] prefixBuffer, int prefixOffset, int prefixLength, byte[] nsBuffer, int nsOffset, int nsLength) 
        {
            WriteXmlnsAttribute(Encoding.UTF8.GetString(prefixBuffer, prefixOffset, prefixLength), Encoding.UTF8.GetString(nsBuffer, nsOffset, nsLength));
        }
        public abstract void WriteXmlnsAttribute(string prefix, XmlDictionaryString ns); 
        public abstract void WriteStartAttribute(string prefix, string localName);
        public virtual void WriteStartAttribute(byte[] prefixBuffer, int prefixOffset, int prefixLength, byte[] localNameBuffer, int localNameOffset, int localNameLength) 
        { 
            WriteStartAttribute(Encoding.UTF8.GetString(prefixBuffer, prefixOffset, prefixLength), Encoding.UTF8.GetString(localNameBuffer, localNameOffset, localNameLength));
        } 
        public abstract void WriteStartAttribute(string prefix, XmlDictionaryString localName);
        public abstract void WriteEndAttribute();
        public abstract void WriteCharEntity(int ch);
        public abstract void WriteEscapedText(string value); 
        public abstract void WriteEscapedText(XmlDictionaryString value);
        public abstract void WriteEscapedText(char[] chars, int offset, int count); 
        public abstract void WriteEscapedText(byte[] buffer, int offset, int count); 
        public abstract void WriteText(string value);
        public abstract void WriteText(XmlDictionaryString value); 
        public abstract void WriteText(char[] chars, int offset, int count);
        public abstract void WriteText(byte[] buffer, int offset, int count);
        public abstract void WriteInt32Text(int value);
        public abstract void WriteInt64Text(Int64 value); 
        public abstract void WriteBoolText(bool value);
        public abstract void WriteUInt64Text(UInt64 value); 
        public abstract void WriteFloatText(float value); 
        public abstract void WriteDoubleText(double value);
        public abstract void WriteDecimalText(decimal value); 
        public abstract void WriteDateTimeText(DateTime value);
        public abstract void WriteUniqueIdText(UniqueId value);
        public abstract void WriteTimeSpanText(TimeSpan value);
        public abstract void WriteGuidText(Guid value); 
        public abstract void WriteStartListText();
        public abstract void WriteListSeparator(); 
        public abstract void WriteEndListText(); 
        public abstract void WriteBase64Text(byte[] trailBuffer, int trailCount, byte[] buffer, int offset, int count);
        public abstract void WriteQualifiedName(string prefix, XmlDictionaryString localName); 

        class XmlNullNodeWriter : XmlNodeWriter
        {
            public override void Flush() {} 
            public override void Close() {}
            public override void WriteDeclaration() {} 
            public override void WriteComment(string text) {} 
            public override void WriteCData(string text) {}
            public override void WriteStartElement(string prefix, string localName) {} 
            public override void WriteStartElement(byte[] prefixBuffer, int prefixOffset, int prefixLength, byte[] localNameBuffer, int localNameOffset, int localNameLength) {}
            public override void WriteStartElement(string prefix, XmlDictionaryString localName) {}
            public override void WriteEndStartElement(bool isEmpty) {}
            public override void WriteEndElement(string prefix, string localName) {} 
            public override void WriteEndElement(byte[] prefixBuffer, int prefixOffset, int prefixLength, byte[] localNameBuffer, int localNameOffset, int localNameLength) { }
            public override void WriteXmlnsAttribute(string prefix, string ns) {} 
            public override void WriteXmlnsAttribute(byte[] prefixBuffer, int prefixOffset, int prefixLength, byte[] nsBuffer, int nsOffset, int nsLength) { } 
            public override void WriteXmlnsAttribute(string prefix, XmlDictionaryString ns) {}
            public override void WriteStartAttribute(string prefix, string localName) {} 
            public override void WriteStartAttribute(byte[] prefixBuffer, int prefixOffset, int prefixLength, byte[] localNameBuffer, int localNameOffset, int localNameLength) { }
            public override void WriteStartAttribute(string prefix, XmlDictionaryString localName) {}
            public override void WriteEndAttribute() {}
            public override void WriteCharEntity(int ch) {} 
            public override void WriteEscapedText(string value) {}
            public override void WriteEscapedText(XmlDictionaryString value) {} 
            public override void WriteEscapedText(char[] chars, int offset, int count) {} 
            public override void WriteEscapedText(byte[] buffer, int offset, int count) {}
            public override void WriteText(string value) {} 
            public override void WriteText(XmlDictionaryString value) {}
            public override void WriteText(char[] chars, int offset, int count) {}
            public override void WriteText(byte[] buffer, int offset, int count) {}
            public override void WriteInt32Text(int value) {} 
            public override void WriteInt64Text(Int64 value) {}
            public override void WriteBoolText(bool value) {} 
            public override void WriteUInt64Text(UInt64 value) {} 
            public override void WriteFloatText(float value) {}
            public override void WriteDoubleText(double value) {} 
            public override void WriteDecimalText(decimal value) {}
            public override void WriteDateTimeText(DateTime value) {}
            public override void WriteUniqueIdText(UniqueId value) {}
            public override void WriteTimeSpanText(TimeSpan value) {} 
            public override void WriteGuidText(Guid value) {}
            public override void WriteStartListText() {} 
            public override void WriteListSeparator() {} 
            public override void WriteEndListText() {}
            public override void WriteBase64Text(byte[] trailBuffer, int trailCount, byte[] buffer, int offset, int count) {} 
            public override void WriteQualifiedName(string prefix, XmlDictionaryString localName) {}
        }
    }
} 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
                        

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