mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Remove unnecessary Field exclusion
This commit is contained in:
@@ -7,17 +7,29 @@ namespace SabreTools.Library.IO
|
||||
/// </summary>
|
||||
public static class XmlTextWriterExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Write an attribute, if the value is not null or empty
|
||||
/// </summary>
|
||||
/// <param name="writer">XmlTextWriter to write out with</param>
|
||||
/// <param name="localName">Name of the attribute</param>
|
||||
/// <param name="value">Value to write in the attribute</param>
|
||||
public static void WriteAttributeStringIfExists(this XmlTextWriter writer, string localName, string value)
|
||||
{
|
||||
if (string.IsNullOrEmpty(value))
|
||||
writer.WriteAttributeString(localName, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Force writing separate open and start tags, even for empty elements
|
||||
/// </summary>
|
||||
/// <param name="xmlTextWriter">XmlTextWriter to write out with</param>
|
||||
/// <param name="writer">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)
|
||||
public static void WriteFullElementString(this XmlTextWriter writer, string localName, string value)
|
||||
{
|
||||
xmlTextWriter.WriteStartElement(localName);
|
||||
xmlTextWriter.WriteRaw(value);
|
||||
xmlTextWriter.WriteFullEndElement();
|
||||
writer.WriteStartElement(localName);
|
||||
writer.WriteRaw(value);
|
||||
writer.WriteFullEndElement();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user