2 // XmlWriterSettings.cs
\r
5 // Atsushi Enomoto <atsushi@ximian.com>
\r
7 // (C) 2004 Novell Inc.
\r
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
36 using System.Xml.Schema;
\r
38 namespace System.Xml
\r
40 public class XmlWriterSettings
\r
42 private bool checkCharacters;
\r
43 private bool closeOutput;
\r
44 private ConformanceLevel conformance;
\r
45 private Encoding encoding;
\r
46 private bool indent;
\r
47 private string indentChars;
\r
48 private string newLineChars;
\r
49 private bool newLineOnAttributes;
\r
50 private bool normalizeNewLines;
\r
51 private bool omitXmlDeclaration;
\r
53 public XmlWriterSettings ()
\r
58 private XmlWriterSettings (XmlWriterSettings org)
\r
60 checkCharacters = org.checkCharacters;
\r
61 closeOutput = org.closeOutput;
\r
62 conformance = org.conformance;
\r
63 encoding = org.encoding;
\r
64 indent = org.indent;
\r
65 indentChars = org.indentChars;
\r
66 newLineChars = org.newLineChars;
\r
67 newLineOnAttributes = org.newLineOnAttributes;
\r
68 normalizeNewLines = org.normalizeNewLines;
\r
69 omitXmlDeclaration = org.omitXmlDeclaration;
\r
72 public XmlWriterSettings Clone ()
\r
74 return new XmlWriterSettings (this);
\r
77 public void Reset ()
\r
79 checkCharacters = true;
\r
80 closeOutput = false; // ? not documented
\r
81 conformance = ConformanceLevel.Document;
\r
82 encoding = Encoding.UTF8;
\r
85 // LAMESPEC: MS.NET says it is "\r\n", but it is silly decision.
\r
86 newLineChars = Environment.NewLine;
\r
87 newLineOnAttributes = false;
\r
88 normalizeNewLines = true;
\r
89 omitXmlDeclaration = false;
\r
92 // It affects only on XmlTextWriter
\r
93 public bool CheckCharacters {
\r
94 get { return checkCharacters; }
\r
95 set { checkCharacters = value; }
\r
98 // It affects only on XmlTextWriter
\r
99 public bool CloseOutput {
\r
100 get { return closeOutput; }
\r
101 set { closeOutput = value; }
\r
104 // It affects only on XmlTextWriter????
\r
105 public ConformanceLevel ConformanceLevel {
\r
106 get { return conformance; }
\r
107 set { conformance = value; }
\r
110 public Encoding Encoding {
\r
111 get { return encoding; }
\r
112 set { encoding = value; }
\r
115 // It affects only on XmlTextWriter
\r
116 public bool Indent {
\r
117 get { return indent; }
\r
118 set { indent = value; }
\r
121 // It affects only on XmlTextWriter
\r
122 public string IndentChars {
\r
123 get { return indentChars; }
\r
124 set { indentChars = value; }
\r
127 // It affects only on XmlTextWriter
\r
128 public string NewLineChars {
\r
129 get { return newLineChars; }
\r
130 set { newLineChars = value; }
\r
133 // It affects only on XmlTextWriter
\r
134 public bool NewLineOnAttributes {
\r
135 get { return newLineOnAttributes; }
\r
136 set { newLineOnAttributes = value; }
\r
139 // It affects only on XmlTextWriter
\r
140 public bool NormalizeNewLines {
\r
141 get { return normalizeNewLines; }
\r
142 set { normalizeNewLines = value; }
\r
145 // It affects only on XmlTextWriter
\r
146 public bool OmitXmlDeclaration {
\r
147 get { return omitXmlDeclaration; }
\r
148 set { omitXmlDeclaration = value; }
\r