Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CreateWriter() [1/4]

XmlWriter System.Xml.XmlWriterSettings.CreateWriter ( Stream output)
inlinepackage

Definition at line 439 of file XmlWriterSettings.cs.

440 {
441 if (output == null)
442 {
443 throw new ArgumentNullException("output");
444 }
445 XmlWriter xmlWriter;
446 if (Encoding.WebName == "utf-8")
447 {
448 switch (OutputMethod)
449 {
450 case XmlOutputMethod.Xml:
451 xmlWriter = ((!Indent) ? new XmlUtf8RawTextWriter(output, this) : new XmlUtf8RawTextWriterIndent(output, this));
452 break;
453 case XmlOutputMethod.Html:
454 xmlWriter = ((!Indent) ? new HtmlUtf8RawTextWriter(output, this) : new HtmlUtf8RawTextWriterIndent(output, this));
455 break;
456 case XmlOutputMethod.Text:
457 xmlWriter = new TextUtf8RawTextWriter(output, this);
458 break;
459 case XmlOutputMethod.AutoDetect:
460 xmlWriter = new XmlAutoDetectWriter(output, this);
461 break;
462 default:
463 return null;
464 }
465 }
466 else
467 {
468 switch (OutputMethod)
469 {
470 case XmlOutputMethod.Xml:
471 xmlWriter = ((!Indent) ? new XmlEncodedRawTextWriter(output, this) : new XmlEncodedRawTextWriterIndent(output, this));
472 break;
473 case XmlOutputMethod.Html:
474 xmlWriter = ((!Indent) ? new HtmlEncodedRawTextWriter(output, this) : new HtmlEncodedRawTextWriterIndent(output, this));
475 break;
476 case XmlOutputMethod.Text:
477 xmlWriter = new TextEncodedRawTextWriter(output, this);
478 break;
479 case XmlOutputMethod.AutoDetect:
480 xmlWriter = new XmlAutoDetectWriter(output, this);
481 break;
482 default:
483 return null;
484 }
485 }
486 if (OutputMethod != XmlOutputMethod.AutoDetect && IsQuerySpecific)
487 {
488 xmlWriter = new QueryOutputWriter((XmlRawWriter)xmlWriter, this);
489 }
490 xmlWriter = new XmlWellFormedWriter(xmlWriter, this);
491 if (_useAsync)
492 {
493 xmlWriter = new XmlAsyncCheckWriter(xmlWriter);
494 }
495 return xmlWriter;
496 }
virtual string WebName
Definition Encoding.cs:386

References System.Xml.XmlWriterSettings._useAsync, System.Xml.Dictionary, System.Xml.XmlWriterSettings.Indent, System.Xml.XmlWriterSettings.IsQuerySpecific, and System.Text.Encoding.WebName.