using Deltares.Geotechnics.Mechanisms; using Deltares.Standard; using Deltares.Standard.Attributes; using Deltares.Standard.EventPublisher; using Deltares.Standard.Language; using Deltares.Standard.Units; namespace Deltares.Geotechnics.IO { /// /// Relation between Location for a mechanism and SoilProfile2D. /// [TrackChanges] public class SpecificMechanismPointLocation { private Mechanism mechanism; private SoilProfile2D soilProfile2D; private double xCoordinate = double.NaN; /// /// Gets or sets the x coordinate of the mechanism location. /// [Unit(UnitType.Length)] [Format("F3")] public double XCoordinate { get { return xCoordinate; } set { DataEventPublisher.BeforeChange(this, prop => prop.XCoordinate); xCoordinate = value; DataEventPublisher.AfterChange(this, prop => prop.XCoordinate); } } /// /// Gets or sets the Soil Profile 2D. /// public SoilProfile2D SoilProfile2D { get { return soilProfile2D; } set { DataEventPublisher.BeforeChange(this, prop => prop.SoilProfile2D); soilProfile2D = value; DataEventPublisher.AfterChange(this, prop => prop.SoilProfile2D); } } /// /// Gets or sets the mechanism. /// public Mechanism Mechanism { get { return mechanism; } set { DataEventPublisher.BeforeChange(this, prop => prop.Mechanism); mechanism = value; DataEventPublisher.AfterChange(this, prop => prop.Mechanism); } } /// /// Returns a that represents this instance. /// public override string ToString() { var mechanismText = Mechanism != Mechanism.None ? Mechanism.ToString() : "Mechanism"; var mechanismLabel = LocalizationManager.GetTranslatedText(typeof(Mechanism), mechanismText); var locationLabel = LocalizationManager.GetTranslatedText(typeof(Mechanism), "Location").ToLower(); return string.Format("{0} {1}", mechanismLabel, locationLabel); } } }