Exemplo n.º 1
0
        /// <summary>
        /// Assigns the read location input configuration to the of <paramref name="locationInput"/>.
        /// </summary>
        /// <param name="configurationLocationInput">The location input configuration read from the imported file.</param>
        /// <param name="locationInput">The location input to configure.</param>
        private static void SetMacroStabilityInwardsLocationInputExtreme(MacroStabilityInwardsLocationInputExtremeConfiguration configurationLocationInput,
                                                                         IMacroStabilityInwardsLocationInputExtreme locationInput)
        {
            if (configurationLocationInput == null)
            {
                return;
            }

            if (configurationLocationInput.PenetrationLength.HasValue)
            {
                locationInput.PenetrationLength = (RoundedDouble)configurationLocationInput.PenetrationLength.Value;
            }

            SetMacroStabilityInwardsLocationInput(configurationLocationInput, locationInput);
        }
        /// <summary>
        /// Writes a location input configuration for extreme conditions in XML format to file
        /// when <paramref name="configuration"/> has a value.
        /// </summary>
        /// <param name="writer">The writer to use for writing.</param>
        /// <param name="configuration">The configuration for the location input that can be <c>null</c>.</param>
        /// <exception cref="InvalidOperationException">Thrown when the <paramref name="writer"/>
        /// is closed.</exception>
        private static void WriteLocationExtremeInputWhenAvailable(XmlWriter writer,
                                                                   MacroStabilityInwardsLocationInputExtremeConfiguration configuration)
        {
            if (configuration == null)
            {
                return;
            }

            writer.WriteStartElement(MacroStabilityInwardsCalculationConfigurationSchemaIdentifiers.LocationInputExtremeElement);

            WriteElementWhenContentAvailable(writer,
                                             MacroStabilityInwardsCalculationConfigurationSchemaIdentifiers.WaterLevelPolderElement,
                                             configuration.WaterLevelPolder);

            WriteElementWhenContentAvailable(writer,
                                             MacroStabilityInwardsCalculationConfigurationSchemaIdentifiers.PenetrationLengthElement,
                                             configuration.PenetrationLength);

            WriteLocationLocationInputOffset(writer, configuration);

            writer.WriteEndElement();
        }