/// <summary> /// Creates a new instance of <see cref="UseForeshoreProperties"/>. /// </summary> /// <param name="useForeshoreData">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 UseForeshoreProperties( IUseForeshore useForeshoreData, IObservablePropertyChangeHandler handler) { if (useForeshoreData == null) { throw new ArgumentNullException(nameof(useForeshoreData)); } if (handler == null) { throw new ArgumentNullException(nameof(handler)); } data = useForeshoreData; changeHandler = handler; }
/// <summary> /// Parses the foreshore geometry of a calculation input object into a <see cref="IEnumerable{T}"/> of /// <see cref="HydraRingForelandPoint"/>. /// </summary> /// <param name="input">A calculation input object that implements <see cref="IUseForeshore"/>.</param> /// <returns>A <see cref="IEnumerable{T}"/> of <see cref="HydraRingForelandPoint"/>.</returns> public static IEnumerable <HydraRingForelandPoint> ParseForeshore(IUseForeshore input) { return(input.UseForeshore ? input.ForeshoreGeometry.Select(c => new HydraRingForelandPoint(c.X, c.Y)).ToArray() : new HydraRingForelandPoint[0]); }