예제 #1
0
        /// <summary>
        /// Writes the <paramref name="stepSize"/> in XML format to file.
        /// </summary>
        /// <param name="writer">The writer to use for writing.</param>
        /// <param name="stepSize">The stepsize to write.</param>
        /// <exception cref="InvalidOperationException">Thrown when the <paramref name="writer"/>
        /// is closed.</exception>
        /// <exception cref="NotSupportedException">Thrown when the conversion
        /// of <paramref name="stepSize"/> cannot be performed.</exception>
        private static void WriteConfigurationWaveConditionsInputStepSizeWhenAvailable(
            XmlWriter writer,
            ConfigurationWaveConditionsInputStepSize?stepSize)
        {
            if (!stepSize.HasValue)
            {
                return;
            }

            var converter = new ConfigurationWaveConditionsInputStepSizeConverter();

            writer.WriteElementString(WaveConditionsCalculationConfigurationSchemaIdentifiers.StepSize,
                                      converter.ConvertToInvariantString(stepSize.Value));
        }