/// <summary> /// Creates a new instance of <see cref="UseBreakWaterProperties"/>in which the /// properties are editable. /// </summary> /// <param name="useBreakWaterData">The data to use for the properties.</param> /// <param name="handler">Optional handler that is used to handle property changes.</param> /// <exception cref="ArgumentNullException">Thrown when any input parameter is <c>null</c>.</exception> public UseBreakWaterProperties( IUseBreakWater useBreakWaterData, IObservablePropertyChangeHandler handler) { if (useBreakWaterData == null) { throw new ArgumentNullException(nameof(useBreakWaterData)); } if (handler == null) { throw new ArgumentNullException(nameof(handler)); } data = useBreakWaterData; changeHandler = handler; }
/// <summary> /// Parses the breakwater properties of a calculation input object into a <see cref="HydraRingBreakWater"/> object. /// </summary> /// <param name="input">A calculation input object that implements <see cref="IUseBreakWater"/>.</param> /// <returns>A <see cref="HydraRingBreakWater"/> object, <c>null</c> if <see cref="IUseBreakWater.UseBreakWater"/> /// is <c>false</c></returns> /// <exception cref="InvalidEnumArgumentException">Thrown when the break water type is an invalid value.</exception> /// <exception cref="NotSupportedException">Thrown when the break water type is a valid value, but unsupported.</exception> public static HydraRingBreakWater ParseBreakWater(IUseBreakWater input) { return(input.UseBreakWater ? new HydraRingBreakWater(ConvertBreakWaterType(input.BreakWater.Type), input.BreakWater.Height) : null); }
/// <summary> /// Creates a new instance of <see cref="UseBreakWaterRule"/> to validate the properties of calculation inputs that implement /// <see cref="IUseBreakWater"/>. /// </summary> /// <param name="breakWater">The <see cref="IUseBreakWater"/> that needs to be validated.</param> public UseBreakWaterRule(IUseBreakWater breakWater) { this.breakWater = breakWater; }