Index: Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/Properties/Resources.Designer.cs =================================================================== diff -u --- Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/Properties/Resources.Designer.cs (revision 0) +++ Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/Properties/Resources.Designer.cs (revision 05f15dbef4e52da9f476beb11e4077df52a055d8) @@ -0,0 +1,99 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34209 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Revetment.Forms.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Ringtoets.Revetment.Forms.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Waterstand [m+NAP]. + /// + internal static string WaveConditionsOutput_WaterLevel_DisplayName { + get { + return ResourceManager.GetString("WaveConditionsOutput_WaterLevel_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Golfrichting [°]. + /// + internal static string WaveConditionsOutput_WaveAngle_DisplayName { + get { + return ResourceManager.GetString("WaveConditionsOutput_WaveAngle_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Golfhoogte [m]. + /// + internal static string WaveConditionsOutput_WaveHeight_DisplayName { + get { + return ResourceManager.GetString("WaveConditionsOutput_WaveHeight_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Golfperiode [s]. + /// + internal static string WaveConditionsOutput_WavePeakPeriod_DisplayName { + get { + return ResourceManager.GetString("WaveConditionsOutput_WavePeakPeriod_DisplayName", resourceCulture); + } + } + } +} Index: Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/Properties/Resources.resx =================================================================== diff -u --- Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/Properties/Resources.resx (revision 0) +++ Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/Properties/Resources.resx (revision 05f15dbef4e52da9f476beb11e4077df52a055d8) @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Waterstand [m+NAP] + + + Golfrichting [°] + + + Golfhoogte [m] + + + Golfperiode [s] + + \ No newline at end of file Index: Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/PropertyClasses/WaveConditionsOutputProperties.cs =================================================================== diff -u --- Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/PropertyClasses/WaveConditionsOutputProperties.cs (revision 0) +++ Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/PropertyClasses/WaveConditionsOutputProperties.cs (revision 05f15dbef4e52da9f476beb11e4077df52a055d8) @@ -0,0 +1,76 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets 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.ComponentModel; +using Core.Common.Base.Data; +using Core.Common.Gui.PropertyBag; +using Core.Common.Utils.Attributes; +using Ringtoets.Common.Forms.TypeConverters; +using Ringtoets.Revetment.Data; +using Ringtoets.Revetment.Forms.Properties; +using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; + +namespace Ringtoets.Revetment.Forms.PropertyClasses +{ + [TypeConverter(typeof(ExpandableObjectConverter))] + public class WaveConditionsOutputProperties : ObjectProperties + { + [TypeConverter(typeof(NoValueRoundedDoubleConverter))] + [ResourcesDisplayName(typeof(Resources), "WaveConditionsOutput_WaterLevel_DisplayName")] + public RoundedDouble WaterLevel + { + get + { + return data.WaterLevel; + } + } + + [TypeConverter(typeof(NoValueRoundedDoubleConverter))] + [ResourcesDisplayName(typeof(Resources), "WaveConditionsOutput_WaveHeight_DisplayName")] + public RoundedDouble WaveHeight + { + get + { + return data.WaveHeight; + } + } + + [TypeConverter(typeof(NoValueRoundedDoubleConverter))] + [ResourcesDisplayName(typeof(Resources), "WaveConditionsOutput_WavePeakPeriod_DisplayName")] + public RoundedDouble WavePeakPeriod + { + get + { + return data.WavePeakPeriod; + } + } + + [TypeConverter(typeof(NoValueRoundedDoubleConverter))] + [ResourcesDisplayName(typeof(Resources), "WaveConditionsOutput_WaveAngle_DisplayName")] + public RoundedDouble WaveAngle + { + get + { + return data.WaveAngle; + } + } + } +} \ No newline at end of file Index: Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/Ringtoets.Revetment.Forms.csproj =================================================================== diff -u -rbcea123bdb3c5dc3649b066f675e3e5cc1a8bc89 -r05f15dbef4e52da9f476beb11e4077df52a055d8 --- Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/Ringtoets.Revetment.Forms.csproj (.../Ringtoets.Revetment.Forms.csproj) (revision bcea123bdb3c5dc3649b066f675e3e5cc1a8bc89) +++ Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/Ringtoets.Revetment.Forms.csproj (.../Ringtoets.Revetment.Forms.csproj) (revision 05f15dbef4e52da9f476beb11e4077df52a055d8) @@ -40,12 +40,56 @@ Properties\GlobalAssembly.cs + + True + True + Resources.resx + + Copying.licenseheader + + + {3bbfd65b-b277-4e50-ae6d-bd24c3434609} + Core.Common.Base + False + + + {30E4C2AE-719E-4D70-9FA9-668A9767FBFA} + Core.Common.Gui + False + + + {F49BD8B2-332A-4C91-A196-8CCE0A2C7D98} + Core.Common.Utils + False + + + {d4200f43-3f72-4f42-af0a-8ced416a38ec} + Ringtoets.Common.Data + False + + + {4D840673-3812-4338-A352-84854E32B8A0} + Ringtoets.Common.Forms + False + + + {87C2C553-C0BC-40BF-B1EA-B83BFF357F27} + Ringtoets.Revetment.Data + False + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + + \ No newline at end of file Index: Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -r0d98073e4ba2bdc6b69b7f875508488d1fa0148a -r05f15dbef4e52da9f476beb11e4077df52a055d8 --- Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 0d98073e4ba2bdc6b69b7f875508488d1fa0148a) +++ Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 05f15dbef4e52da9f476beb11e4077df52a055d8) @@ -22,7 +22,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18444 +// Runtime Version:4.0.30319.34209 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -90,5 +90,23 @@ return ((System.Drawing.Bitmap)(obj)); } } + + /// + /// Looks up a localized string similar to Blokken. + /// + public static string WaveConditionsOutput_Blocks_DisplayName { + get { + return ResourceManager.GetString("WaveConditionsOutput_Blocks_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Zuilen. + /// + public static string WaveConditionsOutput_Columns_DisplayName { + get { + return ResourceManager.GetString("WaveConditionsOutput_Columns_DisplayName", resourceCulture); + } + } } } Index: Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/Properties/Resources.resx =================================================================== diff -u -r0d98073e4ba2bdc6b69b7f875508488d1fa0148a -r05f15dbef4e52da9f476beb11e4077df52a055d8 --- Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/Properties/Resources.resx (.../Resources.resx) (revision 0d98073e4ba2bdc6b69b7f875508488d1fa0148a) +++ Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/Properties/Resources.resx (.../Resources.resx) (revision 05f15dbef4e52da9f476beb11e4077df52a055d8) @@ -121,4 +121,10 @@ ..\Resources\control_equalizer_blue.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + Blokken + + + Zuilen + \ No newline at end of file Index: Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/PropertyClasses/StabilityStoneCoverWaveConditionsOutputContextProperties.cs =================================================================== diff -u --- Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/PropertyClasses/StabilityStoneCoverWaveConditionsOutputContextProperties.cs (revision 0) +++ Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/PropertyClasses/StabilityStoneCoverWaveConditionsOutputContextProperties.cs (revision 05f15dbef4e52da9f476beb11e4077df52a055d8) @@ -0,0 +1,59 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets 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.ComponentModel; +using System.Linq; +using Core.Common.Gui.PropertyBag; +using Core.Common.Utils.Attributes; +using Ringtoets.Revetment.Forms.PropertyClasses; +using Ringtoets.StabilityStoneCover.Data; +using Ringtoets.StabilityStoneCover.Forms.Properties; + +namespace Ringtoets.StabilityStoneCover.Forms.PropertyClasses +{ + [TypeConverter(typeof(ExpandableObjectConverter))] + public class StabilityStoneCoverWaveConditionsOutputContextProperties : ObjectProperties + { + [ResourcesDisplayName(typeof(Resources), "WaveConditionsOutput_Blocks_DisplayName")] + public WaveConditionsOutputProperties[] Blocks + { + get + { + return data.BlocksOutput.Select(loc => new WaveConditionsOutputProperties + { + Data = loc + }).ToArray(); + } + } + + [ResourcesDisplayName(typeof(Resources), "WaveConditionsOutput_Columns_DisplayName")] + public WaveConditionsOutputProperties[] Columns + { + get + { + return data.ColumnsOutput.Select(loc => new WaveConditionsOutputProperties + { + Data = loc + }).ToArray(); + } + } + } +} Index: Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/Ringtoets.StabilityStoneCover.Forms.csproj =================================================================== diff -u -r0d98073e4ba2bdc6b69b7f875508488d1fa0148a -r05f15dbef4e52da9f476beb11e4077df52a055d8 --- Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/Ringtoets.StabilityStoneCover.Forms.csproj (.../Ringtoets.StabilityStoneCover.Forms.csproj) (revision 0d98073e4ba2bdc6b69b7f875508488d1fa0148a) +++ Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/Ringtoets.StabilityStoneCover.Forms.csproj (.../Ringtoets.StabilityStoneCover.Forms.csproj) (revision 05f15dbef4e52da9f476beb11e4077df52a055d8) @@ -54,6 +54,7 @@ Resources.resx + UserControl @@ -105,6 +106,11 @@ Ringtoets.Revetment.Data False + + {AF1ACFA2-AEE5-4DB7-98CA-8B3720E46AD9} + Ringtoets.Revetment.Forms + False + {b479e3af-7c34-488c-bb73-d324100d36c9} Ringtoets.StabilityStoneCover.Data Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/PropertyClasses/StabilityStoneCoverWaveConditionsOutputContextPropertiesTest.cs =================================================================== diff -u --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/PropertyClasses/StabilityStoneCoverWaveConditionsOutputContextPropertiesTest.cs (revision 0) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/PropertyClasses/StabilityStoneCoverWaveConditionsOutputContextPropertiesTest.cs (revision 05f15dbef4e52da9f476beb11e4077df52a055d8) @@ -0,0 +1,128 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets 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.ComponentModel; +using Core.Common.Gui.PropertyBag; +using NUnit.Framework; +using Ringtoets.Revetment.Data; +using Ringtoets.Revetment.Forms.PropertyClasses; +using Ringtoets.StabilityStoneCover.Data; +using Ringtoets.StabilityStoneCover.Forms.PropertyClasses; + +namespace Ringtoets.StabilityStoneCover.Forms.Test.PropertyClasses +{ + [TestFixture] + public class StabilityStoneCoverWaveConditionsOutputContextPropertiesTest + { + [Test] + public void DefaultConstructor_ExpectedValues() + { + // Call + var properties = new StabilityStoneCoverWaveConditionsOutputContextProperties(); + + //Assert + Assert.IsInstanceOf>(properties); + Assert.IsNull(properties.Data); + } + + [Test] + public void GetColumnProperties_WithData_ReturnExpectedValues() + { + // Setup + var blocksOutput = new[] + { + new WaveConditionsOutput(6, 2, 9, 4), + }; + + var columnsOutput = new[] + { + new WaveConditionsOutput(1, 0, 3, 5), + }; + + var stabilityStoneCoverWaveConditionsOutput = new StabilityStoneCoverWaveConditionsOutput(columnsOutput, blocksOutput); + + // Call + var properties = new StabilityStoneCoverWaveConditionsOutputContextProperties() + { + Data = stabilityStoneCoverWaveConditionsOutput + }; + + //Assert + CollectionAssert.AllItemsAreInstancesOfType(properties.Blocks, typeof(WaveConditionsOutputProperties)); + Assert.AreEqual(blocksOutput.Length, properties.Blocks.Length); + Assert.AreEqual(blocksOutput[0].WaterLevel, properties.Blocks[0].WaterLevel); + Assert.AreEqual(blocksOutput[0].WaveHeight, properties.Blocks[0].WaveHeight); + Assert.AreEqual(blocksOutput[0].WavePeakPeriod, properties.Blocks[0].WavePeakPeriod); + Assert.AreEqual(blocksOutput[0].WaveAngle, properties.Blocks[0].WaveAngle); + + CollectionAssert.AllItemsAreInstancesOfType(properties.Columns, typeof(WaveConditionsOutputProperties)); + Assert.AreEqual(columnsOutput.Length, properties.Columns.Length); + Assert.AreEqual(columnsOutput[0].WaterLevel, properties.Columns[0].WaterLevel); + Assert.AreEqual(columnsOutput[0].WaveHeight, properties.Columns[0].WaveHeight); + Assert.AreEqual(columnsOutput[0].WavePeakPeriod, properties.Columns[0].WavePeakPeriod); + Assert.AreEqual(columnsOutput[0].WaveAngle, properties.Columns[0].WaveAngle); + } + + [Test] + public void PropertyAttributes_ReturnExpectedValues() + { + // Setup + var blocksOutput = new[] + { + new WaveConditionsOutput(6, 2, 9, 4), + }; + + var columnsOutput = new[] + { + new WaveConditionsOutput(1, 0, 3, 5), + }; + + const string expectedColumnDisplayName = "Zuilen"; + const string expectedBlockDisplayName = "Blokken"; + + var stabilityStoneCoverWaveConditionsOutput = new StabilityStoneCoverWaveConditionsOutput(columnsOutput, blocksOutput); + var properties = new StabilityStoneCoverWaveConditionsOutputContextProperties() + { + Data = stabilityStoneCoverWaveConditionsOutput + }; + + // Call + TypeConverter classTypeConverter = TypeDescriptor.GetConverter(properties, true); + + // Asssert + var propertyBag = new DynamicPropertyBag(properties); + + Assert.IsInstanceOf(classTypeConverter); + + PropertyDescriptorCollection dynamicProperties = propertyBag.GetProperties(); + PropertyDescriptor columnsProperty = dynamicProperties.Find("Columns", false); + PropertyDescriptor blocksProperty = dynamicProperties.Find("Blocks", false); + + Assert.IsNotNull(columnsProperty); + Assert.IsTrue(columnsProperty.IsReadOnly); + Assert.AreEqual(expectedColumnDisplayName, columnsProperty.DisplayName); + + Assert.IsNotNull(expectedBlockDisplayName); + Assert.IsTrue(blocksProperty.IsReadOnly); + Assert.AreEqual(expectedBlockDisplayName, blocksProperty.DisplayName); + } + } +} \ No newline at end of file Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Ringtoets.StabilityStoneCover.Forms.Test.csproj =================================================================== diff -u -r2336e45e063aee566b1fa028efed72d531cdf5ee -r05f15dbef4e52da9f476beb11e4077df52a055d8 --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Ringtoets.StabilityStoneCover.Forms.Test.csproj (.../Ringtoets.StabilityStoneCover.Forms.Test.csproj) (revision 2336e45e063aee566b1fa028efed72d531cdf5ee) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Ringtoets.StabilityStoneCover.Forms.Test.csproj (.../Ringtoets.StabilityStoneCover.Forms.Test.csproj) (revision 05f15dbef4e52da9f476beb11e4077df52a055d8) @@ -76,6 +76,7 @@ + @@ -154,6 +155,10 @@ {87c2c553-c0bc-40bf-b1ea-b83bff357f27} Ringtoets.Revetment.Data + + {AF1ACFA2-AEE5-4DB7-98CA-8B3720E46AD9} + Ringtoets.Revetment.Forms + {EA416DD2-1633-439E-8512-B9933E37B9C5} Ringtoets.Revetment.Service.TestUtil