Update Reference Sources to .NET Framework 4.6.1
[mono.git] / mcs / class / referencesource / System.Data.SqlXml / System / Xml / Xsl / Runtime / XmlRawWriterWrapper.cs
1 //------------------------------------------------------------------------------
2 // <copyright file="XmlRawWriterWrapper.cs" company="Microsoft">
3 //     Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>                                                                
5 // <owner current="true" primary="true">[....]</owner>
6 //------------------------------------------------------------------------------
7 using System;
8 using System.IO;
9 using System.Xml;
10 using System.Xml.XPath;
11 using System.Xml.Schema;
12
13 namespace System.Xml.Xsl.Runtime {
14
15     /// <summary>
16     /// This internal class implements the XmlRawWriter interface by passing all calls to a wrapped XmlWriter implementation.
17     /// </summary>
18     sealed internal class XmlRawWriterWrapper : XmlRawWriter {
19         private XmlWriter wrapped;
20
21         public XmlRawWriterWrapper(XmlWriter writer) {
22             this.wrapped = writer;
23         }
24
25
26         //-----------------------------------------------
27         // XmlWriter interface
28         //-----------------------------------------------
29
30         public override XmlWriterSettings Settings { 
31             get { return this.wrapped.Settings; }
32         }
33
34         public override void WriteDocType(string name, string pubid, string sysid, string subset) {
35             this.wrapped.WriteDocType(name, pubid, sysid, subset);
36         }
37
38         public override void WriteStartElement(string prefix, string localName, string ns) {
39             this.wrapped.WriteStartElement(prefix, localName, ns);
40         }
41
42         public override void WriteStartAttribute(string prefix, string localName, string ns) {
43             this.wrapped.WriteStartAttribute(prefix, localName, ns);
44         }
45
46         public override void WriteEndAttribute() {
47             this.wrapped.WriteEndAttribute();
48         }
49
50         public override void WriteCData(string text) {
51             this.wrapped.WriteCData(text);
52         }
53
54         public override void WriteComment(string text) {
55             this.wrapped.WriteComment(text);
56         }
57
58         public override void WriteProcessingInstruction(string name, string text) {
59             this.wrapped.WriteProcessingInstruction(name, text);
60         }
61
62         public override void WriteWhitespace(string ws) {
63             this.wrapped.WriteWhitespace(ws);
64         }
65
66         public override void WriteString(string text) {
67             this.wrapped.WriteString(text);
68         }
69
70         public override void WriteChars(char[] buffer, int index, int count) {
71             this.wrapped.WriteChars(buffer, index, count);
72         }
73
74         public override void WriteRaw(char[] buffer, int index, int count) {
75             this.wrapped.WriteRaw(buffer, index, count);
76         }
77
78         public override void WriteRaw(string data) {
79             this.wrapped.WriteRaw(data);
80         }
81
82         public override void WriteEntityRef(string name) {
83             this.wrapped.WriteEntityRef(name);
84         }
85
86         public override void WriteCharEntity(char ch) {
87             this.wrapped.WriteCharEntity(ch);
88         }
89
90         public override void WriteSurrogateCharEntity(char lowChar, char highChar) {
91             this.wrapped.WriteSurrogateCharEntity(lowChar, highChar);
92         }
93
94         public override void Close() {
95             this.wrapped.Close();
96         }
97
98         public override void Flush() {
99             this.wrapped.Flush();
100         }
101
102         public override void WriteValue(object value) {
103             this.wrapped.WriteValue(value);
104         }
105
106         public override void WriteValue(string value) {
107             this.wrapped.WriteValue(value);
108         }
109
110         public override void WriteValue(bool value) {
111             this.wrapped.WriteValue(value);
112         }
113
114         public override void WriteValue(DateTime value) {
115             this.wrapped.WriteValue(value);
116         }
117         
118         public override void WriteValue(float value) {
119             this.wrapped.WriteValue(value);
120         }
121         
122         public override void WriteValue(decimal value) {
123             this.wrapped.WriteValue(value);
124         }
125         
126         public override void WriteValue(double value) {
127             this.wrapped.WriteValue(value);
128         }
129
130         public override void WriteValue(int value) {
131             this.wrapped.WriteValue(value);
132         }
133
134         public override void WriteValue(long value) {
135             this.wrapped.WriteValue(value);
136         }
137
138         protected override void Dispose(bool disposing) {
139             try {
140                 if (disposing) {
141                     ((IDisposable)this.wrapped).Dispose();
142                 }
143             }
144             finally {
145                 base.Dispose(disposing);
146             }
147         }
148
149
150         //-----------------------------------------------
151         // XmlRawWriter interface
152         //-----------------------------------------------
153
154         /// <summary>
155         /// No-op.
156         /// </summary>
157         internal override void WriteXmlDeclaration(XmlStandalone standalone) {
158         }
159
160         /// <summary>
161         /// No-op.
162         /// </summary>
163         internal override void WriteXmlDeclaration(string xmldecl) {
164         }
165
166         /// <summary>
167         /// No-op.
168         /// </summary>
169         internal override void StartElementContent() {
170         }
171
172         /// <summary>
173         /// Forward to WriteEndElement().
174         /// </summary>
175         internal override void WriteEndElement(string prefix, string localName, string ns) {
176             this.wrapped.WriteEndElement();
177         }
178
179         /// <summary>
180         /// Forward to WriteFullEndElement().
181         /// </summary>
182         internal override void WriteFullEndElement(string prefix, string localName, string ns) {
183             this.wrapped.WriteFullEndElement();
184         }
185
186         /// <summary>
187         /// Forward to WriteAttribute();
188         /// </summary>
189         internal override void WriteNamespaceDeclaration(string prefix, string ns) {
190             if (prefix.Length == 0)
191                 this.wrapped.WriteAttributeString(string.Empty, "xmlns", XmlReservedNs.NsXmlNs, ns);
192             else
193                 this.wrapped.WriteAttributeString("xmlns", prefix, XmlReservedNs.NsXmlNs, ns);
194         }
195     }
196 }