using System; using System.Collections.Generic; using System.Linq; using Ringtoets.Piping.Data.Properties; namespace Ringtoets.Piping.Data { /// /// This class represents a soil profile, which was imported for use in a piping calculation. /// public class PipingSoilProfile { private IEnumerable layers; /// /// Creates a new instance ofL , with the given , and . /// A new collection is created for and used in the . /// /// The name of the profile. /// The bottom level of the profile. /// The collection of layers that should be part of the profile. public PipingSoilProfile(string name, double bottom, IEnumerable layers) { Name = name; Bottom = bottom; Layers = layers; } /// /// Gets the bottom level of the . /// public double Bottom { get; private set; } /// /// Gets the name of . /// public string Name { get; private set; } /// /// Gets a of the for the . /// public IEnumerable Layers { get { return layers; } private set { if (value == null || !value.Any()) { throw new ArgumentException(string.Format(Resources.Error_Cannot_Construct_PipingSoilProfile_Without_Layers)); } layers = value.OrderByDescending(l => l.Top).ToArray(); } } public override string ToString() { return Name; } } }