6 public abstract partial class XmlDictionaryWriter
: XmlWriter
8 void CheckWriteArrayArguments (Array array
, int offset
, int length
)
11 throw new ArgumentNullException ("array");
13 throw new ArgumentOutOfRangeException ("offset is negative");
14 if (offset
> array
.Length
)
15 throw new ArgumentOutOfRangeException ("offset exceeds the length of the destination array");
17 throw new ArgumentOutOfRangeException ("length is negative");
18 if (length
> array
.Length
- offset
)
19 throw new ArgumentOutOfRangeException ("length + offset exceeds the length of the destination array");
22 void CheckDictionaryStringArgs (XmlDictionaryString localName
, XmlDictionaryString namespaceUri
)
24 if (localName
== null)
25 throw new ArgumentNullException ("localName");
26 if (namespaceUri
== null)
27 throw new ArgumentNullException ("namespaceUri");
31 public virtual void WriteArray (string prefix
, XmlDictionaryString localName
, XmlDictionaryString namespaceUri
, bool [] array
, int offset
, int length
)
33 CheckDictionaryStringArgs (localName
, namespaceUri
);
34 WriteArray (prefix
, localName
.Value
, namespaceUri
.Value
, array
, offset
, length
);
37 public virtual void WriteArray (string prefix
, string localName
, string namespaceUri
, bool [] array
, int offset
, int length
)
39 CheckWriteArrayArguments (array
, offset
, length
);
40 for (int i
= 0; i
< length
; i
++) {
41 WriteStartElement (prefix
, localName
, namespaceUri
);
42 WriteValue (array
[offset
+ i
]);
48 public virtual void WriteArray (string prefix
, XmlDictionaryString localName
, XmlDictionaryString namespaceUri
, DateTime
[] array
, int offset
, int length
)
50 CheckDictionaryStringArgs (localName
, namespaceUri
);
51 WriteArray (prefix
, localName
.Value
, namespaceUri
.Value
, array
, offset
, length
);
54 public virtual void WriteArray (string prefix
, string localName
, string namespaceUri
, DateTime
[] array
, int offset
, int length
)
56 CheckWriteArrayArguments (array
, offset
, length
);
57 for (int i
= 0; i
< length
; i
++) {
58 WriteStartElement (prefix
, localName
, namespaceUri
);
59 WriteValue (array
[offset
+ i
]);
65 public virtual void WriteArray (string prefix
, XmlDictionaryString localName
, XmlDictionaryString namespaceUri
, decimal [] array
, int offset
, int length
)
67 CheckDictionaryStringArgs (localName
, namespaceUri
);
68 WriteArray (prefix
, localName
.Value
, namespaceUri
.Value
, array
, offset
, length
);
71 public virtual void WriteArray (string prefix
, string localName
, string namespaceUri
, decimal [] array
, int offset
, int length
)
73 CheckWriteArrayArguments (array
, offset
, length
);
74 for (int i
= 0; i
< length
; i
++) {
75 WriteStartElement (prefix
, localName
, namespaceUri
);
76 WriteValue (array
[offset
+ i
]);
82 public virtual void WriteArray (string prefix
, XmlDictionaryString localName
, XmlDictionaryString namespaceUri
, double [] array
, int offset
, int length
)
84 CheckDictionaryStringArgs (localName
, namespaceUri
);
85 WriteArray (prefix
, localName
.Value
, namespaceUri
.Value
, array
, offset
, length
);
88 public virtual void WriteArray (string prefix
, string localName
, string namespaceUri
, double [] array
, int offset
, int length
)
90 CheckWriteArrayArguments (array
, offset
, length
);
91 for (int i
= 0; i
< length
; i
++) {
92 WriteStartElement (prefix
, localName
, namespaceUri
);
93 WriteValue (array
[offset
+ i
]);
99 public virtual void WriteArray (string prefix
, XmlDictionaryString localName
, XmlDictionaryString namespaceUri
, Guid
[] array
, int offset
, int length
)
101 CheckDictionaryStringArgs (localName
, namespaceUri
);
102 WriteArray (prefix
, localName
.Value
, namespaceUri
.Value
, array
, offset
, length
);
105 public virtual void WriteArray (string prefix
, string localName
, string namespaceUri
, Guid
[] array
, int offset
, int length
)
107 CheckWriteArrayArguments (array
, offset
, length
);
108 for (int i
= 0; i
< length
; i
++) {
109 WriteStartElement (prefix
, localName
, namespaceUri
);
110 WriteValue (array
[offset
+ i
]);
116 public virtual void WriteArray (string prefix
, XmlDictionaryString localName
, XmlDictionaryString namespaceUri
, short [] array
, int offset
, int length
)
118 CheckDictionaryStringArgs (localName
, namespaceUri
);
119 WriteArray (prefix
, localName
.Value
, namespaceUri
.Value
, array
, offset
, length
);
122 public virtual void WriteArray (string prefix
, string localName
, string namespaceUri
, short [] array
, int offset
, int length
)
124 CheckWriteArrayArguments (array
, offset
, length
);
125 for (int i
= 0; i
< length
; i
++) {
126 WriteStartElement (prefix
, localName
, namespaceUri
);
127 WriteValue (array
[offset
+ i
]);
133 public virtual void WriteArray (string prefix
, XmlDictionaryString localName
, XmlDictionaryString namespaceUri
, int [] array
, int offset
, int length
)
135 CheckDictionaryStringArgs (localName
, namespaceUri
);
136 WriteArray (prefix
, localName
.Value
, namespaceUri
.Value
, array
, offset
, length
);
139 public virtual void WriteArray (string prefix
, string localName
, string namespaceUri
, int [] array
, int offset
, int length
)
141 CheckWriteArrayArguments (array
, offset
, length
);
142 for (int i
= 0; i
< length
; i
++) {
143 WriteStartElement (prefix
, localName
, namespaceUri
);
144 WriteValue (array
[offset
+ i
]);
150 public virtual void WriteArray (string prefix
, XmlDictionaryString localName
, XmlDictionaryString namespaceUri
, long [] array
, int offset
, int length
)
152 CheckDictionaryStringArgs (localName
, namespaceUri
);
153 WriteArray (prefix
, localName
.Value
, namespaceUri
.Value
, array
, offset
, length
);
156 public virtual void WriteArray (string prefix
, string localName
, string namespaceUri
, long [] array
, int offset
, int length
)
158 CheckWriteArrayArguments (array
, offset
, length
);
159 for (int i
= 0; i
< length
; i
++) {
160 WriteStartElement (prefix
, localName
, namespaceUri
);
161 WriteValue (array
[offset
+ i
]);
167 public virtual void WriteArray (string prefix
, XmlDictionaryString localName
, XmlDictionaryString namespaceUri
, float [] array
, int offset
, int length
)
169 CheckDictionaryStringArgs (localName
, namespaceUri
);
170 WriteArray (prefix
, localName
.Value
, namespaceUri
.Value
, array
, offset
, length
);
173 public virtual void WriteArray (string prefix
, string localName
, string namespaceUri
, float [] array
, int offset
, int length
)
175 CheckWriteArrayArguments (array
, offset
, length
);
176 for (int i
= 0; i
< length
; i
++) {
177 WriteStartElement (prefix
, localName
, namespaceUri
);
178 WriteValue (array
[offset
+ i
]);
184 public virtual void WriteArray (string prefix
, XmlDictionaryString localName
, XmlDictionaryString namespaceUri
, TimeSpan
[] array
, int offset
, int length
)
186 CheckDictionaryStringArgs (localName
, namespaceUri
);
187 WriteArray (prefix
, localName
.Value
, namespaceUri
.Value
, array
, offset
, length
);
190 public virtual void WriteArray (string prefix
, string localName
, string namespaceUri
, TimeSpan
[] array
, int offset
, int length
)
192 CheckWriteArrayArguments (array
, offset
, length
);
193 for (int i
= 0; i
< length
; i
++) {
194 WriteStartElement (prefix
, localName
, namespaceUri
);
195 WriteValue (array
[offset
+ i
]);