Index: Ringtoets/Common/src/Ringtoets.Common.IO/Configurations/Export/CalculationConfigurationWriter.cs
===================================================================
diff -u -r3a60f4df420a7669a047880a924bf4a0ff67c265 -r30761b3bfd1c77faaf2c0508396b90639850ac4b
--- Ringtoets/Common/src/Ringtoets.Common.IO/Configurations/Export/CalculationConfigurationWriter.cs (.../CalculationConfigurationWriter.cs) (revision 3a60f4df420a7669a047880a924bf4a0ff67c265)
+++ Ringtoets/Common/src/Ringtoets.Common.IO/Configurations/Export/CalculationConfigurationWriter.cs (.../CalculationConfigurationWriter.cs) (revision 30761b3bfd1c77faaf2c0508396b90639850ac4b)
@@ -189,6 +189,35 @@
}
///
+ /// Writes an element with some content when the content has a value.
+ ///
+ /// The writer to use for writing.
+ /// The name of the element.
+ /// The content of the element that can be null.
+ /// Thrown when or
+ /// is null.
+ /// Thrown when the
+ /// is closed.
+ protected static void WriteElementWhenContentAvailable(XmlWriter writer, string elementName, bool? elementContent)
+ {
+ if (writer == null)
+ {
+ throw new ArgumentNullException(nameof(writer));
+ }
+ if (elementName == null)
+ {
+ throw new ArgumentNullException(nameof(elementName));
+ }
+
+ if (elementContent.HasValue)
+ {
+ writer.WriteElementString(
+ elementName,
+ XmlConvert.ToString(elementContent.Value));
+ }
+ }
+
+ ///
/// Writes a wave reduction configuration when it has a value.
///
/// The writer to use for writing.