Wire up a whole bunch of stuff on read

This commit is contained in:
Matt Nadareski
2020-08-23 21:10:29 -07:00
parent 79e7446266
commit a1d81a8e5f
13 changed files with 470 additions and 271 deletions

View File

@@ -0,0 +1,23 @@
using System.Xml;
namespace SabreTools.Library.IO
{
/// <summary>
/// Additional methods for XmlTextWriter
/// </summary>
public static class XmlTextWriterExtensions
{
/// <summary>
/// Force writing separate open and start tags, even for empty elements
/// </summary>
/// <param name="xmlTextWriter">XmlTextWriter to write out with</param>
/// <param name="localName">Name of the element</param>
/// <param name="value">Value to write in the element</param>
public static void WriteFullElementString(this XmlTextWriter xmlTextWriter, string localName, string value)
{
xmlTextWriter.WriteStartElement(localName);
xmlTextWriter.WriteRaw(value);
xmlTextWriter.WriteFullEndElement();
}
}
}