1 write to writer
System.Xml (1)
System\Xml\Serialization\XmlSerializationGeneratedCode.cs (1)
65
this.
writer
= writer;
160 references to writer
System.Xml (160)
System\Xml\Serialization\XmlSerializationGeneratedCode.cs (160)
76
internal IndentedWriter Writer { get { return
writer
; } }
119
writer
.Write(typeof(Hashtable).FullName);
120
writer
.Write(" ");
121
writer
.Write(privateName);
122
writer
.WriteLine(" = null;");
123
writer
.Write("public override ");
124
writer
.Write(typeof(Hashtable).FullName);
126
writer
.Write(" ");
127
writer
.Write(publicName);
128
writer
.WriteLine(" {");
129
writer
.Indent++;
131
writer
.WriteLine("get {");
132
writer
.Indent++;
134
writer
.Write("if (");
135
writer
.Write(privateName);
136
writer
.WriteLine(" == null) {");
137
writer
.Indent++;
139
writer
.Write(typeof(Hashtable).FullName);
140
writer
.Write(" _tmp = new ");
141
writer
.Write(typeof(Hashtable).FullName);
142
writer
.WriteLine("();");
147
writer
.Write("if (");
148
writer
.Write(privateName);
149
writer
.Write(" == null) ");
150
writer
.Write(privateName);
151
writer
.WriteLine(" = _tmp;");
152
writer
.Indent--;
153
writer
.WriteLine("}");
155
writer
.Write("return ");
156
writer
.Write(privateName);
157
writer
.WriteLine(";");
158
writer
.Indent--;
159
writer
.WriteLine("}");
161
writer
.Indent--;
162
writer
.WriteLine("}");
170
writer
.Write("_tmp[");
172
writer
.Write("] = ");
174
writer
.WriteLine(";");
181
writer
.Write("public override ");
182
writer
.Write(typeof(bool).FullName);
183
writer
.Write(" CanSerialize(");
184
writer
.Write(typeof(Type).FullName);
185
writer
.WriteLine(" type) {");
186
writer
.Indent++;
202
writer
.Write("if (type == typeof(");
203
writer
.Write(CodeIdentifier.GetCSharpName(type));
204
writer
.WriteLine(")) return true;");
206
writer
.WriteLine("return false;");
207
writer
.Indent--;
208
writer
.WriteLine("}");
215
writer
.WriteLine();
216
writer
.Write("public abstract class ");
217
writer
.Write(CodeIdentifier.GetCSharpName(baseSerializer));
218
writer
.Write(" : ");
219
writer
.Write(typeof(XmlSerializer).FullName);
220
writer
.WriteLine(" {");
221
writer
.Indent++;
223
writer
.Write("protected override ");
224
writer
.Write(typeof(XmlSerializationReader).FullName);
225
writer
.WriteLine(" CreateReader() {");
226
writer
.Indent++;
227
writer
.Write("return new ");
228
writer
.Write(readerClass);
229
writer
.WriteLine("();");
230
writer
.Indent--;
231
writer
.WriteLine("}");
233
writer
.Write("protected override ");
234
writer
.Write(typeof(XmlSerializationWriter).FullName);
235
writer
.WriteLine(" CreateWriter() {");
236
writer
.Indent++;
237
writer
.Write("return new ");
238
writer
.Write(writerClass);
239
writer
.WriteLine("();");
240
writer
.Indent--;
241
writer
.WriteLine("}");
243
writer
.Indent--;
244
writer
.WriteLine("}");
253
writer
.WriteLine();
254
writer
.Write("public sealed class ");
255
writer
.Write(CodeIdentifier.GetCSharpName(serializerName));
256
writer
.Write(" : ");
257
writer
.Write(baseSerializer);
258
writer
.WriteLine(" {");
259
writer
.Indent++;
261
writer
.WriteLine();
262
writer
.Write("public override ");
263
writer
.Write(typeof(bool).FullName);
264
writer
.Write(" CanDeserialize(");
265
writer
.Write(typeof(XmlReader).FullName);
266
writer
.WriteLine(" xmlReader) {");
267
writer
.Indent++;
270
writer
.WriteLine("return true;");
273
writer
.Write("return xmlReader.IsStartElement(");
275
writer
.Write(", ");
277
writer
.WriteLine(");");
279
writer
.Indent--;
280
writer
.WriteLine("}");
283
writer
.WriteLine();
284
writer
.Write("protected override void Serialize(object objectToSerialize, ");
285
writer
.Write(typeof(XmlSerializationWriter).FullName);
286
writer
.WriteLine(" writer) {");
287
writer
.Indent++;
288
writer
.Write("((");
289
writer
.Write(writerClass);
290
writer
.Write(")writer).");
291
writer
.Write(writeMethod);
292
writer
.Write("(");
294
writer
.Write("(object[])");
296
writer
.WriteLine("objectToSerialize);");
297
writer
.Indent--;
298
writer
.WriteLine("}");
301
writer
.WriteLine();
302
writer
.Write("protected override object Deserialize(");
303
writer
.Write(typeof(XmlSerializationReader).FullName);
304
writer
.WriteLine(" reader) {");
305
writer
.Indent++;
306
writer
.Write("return ((");
307
writer
.Write(readerClass);
308
writer
.Write(")reader).");
309
writer
.Write(readMethod);
310
writer
.WriteLine("();");
311
writer
.Indent--;
312
writer
.WriteLine("}");
314
writer
.Indent--;
315
writer
.WriteLine("}");
325
writer
.Write("_tmp.Add(");
327
writer
.Write(", new ");
328
writer
.Write((string)serializers[key]);
329
writer
.WriteLine("());");
336
writer
.Write("public override ");
337
writer
.Write(typeof(XmlSerializer).FullName);
338
writer
.Write(" GetSerializer(");
339
writer
.Write(typeof(Type).FullName);
340
writer
.WriteLine(" type) {");
341
writer
.Indent++;
354
writer
.Write("if (type == typeof(");
355
writer
.Write(CodeIdentifier.GetCSharpName(type));
356
writer
.Write(")) return new ");
357
writer
.Write((string)serializers[xmlMappings[i].Key]);
358
writer
.WriteLine("();");
361
writer
.WriteLine("return null;");
362
writer
.Indent--;
363
writer
.WriteLine("}");
367
writer
.WriteLine();
368
writer
.Write("public class XmlSerializerContract : global::");
369
writer
.Write(typeof(XmlSerializerImplementation).FullName);
370
writer
.WriteLine(" {");
371
writer
.Indent++;
373
writer
.Write("public override global::");
374
writer
.Write(typeof(XmlSerializationReader).FullName);
375
writer
.Write(" Reader { get { return new ");
376
writer
.Write(readerType);
377
writer
.WriteLine("(); } }");
379
writer
.Write("public override global::");
380
writer
.Write(typeof(XmlSerializationWriter).FullName);
381
writer
.Write(" Writer { get { return new ");
382
writer
.Write(writerType);
383
writer
.WriteLine("(); } }");
391
writer
.Indent--;
392
writer
.WriteLine("}");