// Copyright (C) Stichting Deltares 2017. All rights reserved. // // This file is part of the application DAM - UI. // // DAM - UI is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // All names, logos, and references to "Deltares" are registered trademarks of // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. using System.Windows.Forms; using Deltares.Dam.Data; using Deltares.Standard; using Deltares.Standard.Forms; using Deltares.Standard.Forms.DExpress; namespace Deltares.Dam.Forms { public partial class LocationPropertyControl : UserControl, IPropertyControl { private Location location = null; public LocationPropertyControl() { InitializeComponent(); this.Name = "Location"; BindSupport.BindTextAndValue(this, this.DikeLabel, this.DikeEdit, typeof (Location), "DikeRingId"); BindSupport.BindTextAndValue(this, this.NameLabel, this.NameValue, typeof (Location), "Name"); BindSupport.BindTextValueAndUnit(this, this.XLabel, this.XEdit, typeof (Location), "XRd"); BindSupport.BindTextValueAndUnit(this, this.YLabel, this.YEdit, typeof (Location), "YRd"); BindSupport.BindTextValueAndUnit(this, this.BoezemLevelTpLabel, this.BoezemLevelTpEdit, typeof (Location), "BoezemLevelTp"); BindSupport.BindTextValueAndUnit(this, this.BoezemLevelHbpLabel, this.BoezemLevelHbpEdit, typeof (Location), "BoezemLevelHbp"); BindSupport.BindTextValueAndUnit(this, this.BoezemLevelLbpLabel, this.BoezemLevelLbpEdit, typeof (Location), "BoezemLevelLbp"); BindSupport.BindTextValueAndUnit(this, this.PolderLevelLabel, this.PolderLevelEdit, typeof (Location), "PolderLevel"); BindSupport.BindTextValueAndUnit(this, this.PolderLevelLowLabel, this.PolderLevelLowEdit, typeof (Location), "PolderLevelLow"); BindSupport.BindTextValueAndUnit(this, this.HeadPL2Label, this.HeadPL2Edit, typeof (Location), "HeadPL2"); BindSupport.BindTextValueAndUnit(this, this.HeadPL3Label, this.HeadPL3Edit, typeof (Location), "HeadPl3"); BindSupport.BindTextValueAndUnit(this, this.HeadPL4Label, this.HeadPL4Edit, typeof (Location), "HeadPl4"); BindSupport.BindTextValueAndUnit(this, this.TrafficLoadLabel, this.TrafficLoadEdit, typeof (Location), "TrafficLoad"); BindSupport.BindTextAndValue(this, this.DikeEmbankmentMaterialLabel, this.DikeEmbankmentMaterialEdit, typeof (Location), "DikeEmbankmentMaterial"); BindSupport.BindTextAndValue(this, this.ShoulderEmbankmentMaterialLabel, this.ShoulderEmbankmentMaterialEdit, typeof (Location), "ShoulderEmbankmentMaterial"); BindSupport.BindTextValueAndUnit(this, this.StabilityShoulderGrowSlopeLabel, this.StabilityShoulderGrowSlopeEdit, typeof (Location), "StabilityShoulderGrowSlope"); BindSupport.BindTextValueAndUnit(this, this.StabilityShoulderGrowDeltaXLabel, this.StabilityShoulderGrowDeltaXEdit, typeof (Location), "StabilityShoulderGrowDeltaX"); BindSupport.BindTextValueAndUnit(this, this.StabilitySlopeAdaptionDeltaXLabel, this.StabilitySlopeAdaptionDeltaXEdit, typeof (Location), "StabilitySlopeAdaptionDeltaX"); BindSupport.BindTextAndValue(this, this.PLLineCreationMethodLabel, this.PLLineCreationMethodComboBox, typeof (Location), "PLLineCreationMethod"); BindSupport.BindTextAndValue(this, this.ZoneLabel, this.ZoneEdit, typeof (Location), "StabilityZoneType"); BindSupport.BindTextValueAndUnit(this, this.MininumCircleDepthLabel, this.MinimumCircleDepthEdit, typeof (Location), "MinimalCircleDepth"); // add groupcontrols for translation LocalizationSupport.Register(typeof (Location), this.IdentificationGroupControl, this.LoadGroupControl, this.PiezometricGroupControl, this.DesignGroupControl, this.CalculationGroupControl); FormsSupport.RepairRightAnchoredControls(this); FormsSupport.AdjustSizeToContents(this.WaterLevelGroup); FormsSupport.AdjustSizeToContents(this.PiezometricGroupControl); FormsSupport.AdjustSizeToContents(this.CalculationGroupControl); FormsSupport.AdjustSizeToContents(this.DesignGroupControl); } #region IPropertyControl Members public object SelectedObject { get { return location; } set { if (value is Location) { location = value as Location; } else if (value is LocationJob) { location = ((LocationJob)value).Location; } else if (value is RWScenarioProfileResult) { location = ((RWScenarioProfileResult)value).Location; } BindSupport.Assign(this, location); } } public bool IsVisible { get { return true; } } #endregion } }