Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Factories/RingtoetsMapDataFactory.cs =================================================================== diff -u -rd04fe66045d6183879fd4e70bab196d127039350 -rb19983374f4a64979bbb5167bcab288a921aa5e5 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Factories/RingtoetsMapDataFactory.cs (.../RingtoetsMapDataFactory.cs) (revision d04fe66045d6183879fd4e70bab196d127039350) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Factories/RingtoetsMapDataFactory.cs (.../RingtoetsMapDataFactory.cs) (revision b19983374f4a64979bbb5167bcab288a921aa5e5) @@ -89,7 +89,7 @@ /// The created . public static MapLineData CreateFailureMechanismSectionsMapData() { - return new MapLineData(Resources.FailureMechanism_Sections_DisplayName, + return new MapLineData(Resources.FailureMechanismSections_DisplayName, new LineStyle { Color = Color.Khaki, @@ -107,7 +107,7 @@ /// The created . public static MapPointData CreateFailureMechanismSectionsStartPointMapData() { - string mapDataName = $"{Resources.FailureMechanism_Sections_DisplayName} ({Resources.FailureMechanismSections_StartPoints_DisplayName})"; + string mapDataName = $"{Resources.FailureMechanismSections_DisplayName} ({Resources.FailureMechanismSections_StartPoints_DisplayName})"; Color color = Color.DarkKhaki; return new MapPointData(mapDataName, @@ -127,7 +127,7 @@ /// The created . public static MapPointData CreateFailureMechanismSectionsEndPointMapData() { - string mapDataName = $"{Resources.FailureMechanism_Sections_DisplayName} ({Resources.FailureMechanismSections_EndPoints_DisplayName})"; + string mapDataName = $"{Resources.FailureMechanismSections_DisplayName} ({Resources.FailureMechanismSections_EndPoints_DisplayName})"; Color color = Color.DarkKhaki; return new MapPointData(mapDataName, Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -r44f75ace98dd75de607002abd122dfe8310d5456 -rb19983374f4a64979bbb5167bcab288a921aa5e5 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 44f75ace98dd75de607002abd122dfe8310d5456) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision b19983374f4a64979bbb5167bcab288a921aa5e5) @@ -40,7 +40,7 @@ // 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.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] public class Resources { @@ -1265,15 +1265,6 @@ } /// - /// Looks up a localized string similar to Vakindeling. - /// - public static string FailureMechanism_Sections_DisplayName { - get { - return ResourceManager.GetString("FailureMechanism_Sections_DisplayName", resourceCulture); - } - } - - /// /// Looks up a localized string similar to Valideer alle berekeningen binnen dit toetsspoor.. /// public static string FailureMechanism_Validate_all_ToolTip { @@ -1437,6 +1428,24 @@ } /// + /// Looks up a localized string similar to Vakindeling waarmee de waterkering voor dit toetsspoor is geschematiseerd ten behoeve van de beoordeling.. + /// + public static string FailureMechanismSections_Description { + get { + return ResourceManager.GetString("FailureMechanismSections_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Vakindeling. + /// + public static string FailureMechanismSections_DisplayName { + get { + return ResourceManager.GetString("FailureMechanismSections_DisplayName", resourceCulture); + } + } + + /// /// Looks up a localized string similar to eindpunten. /// public static string FailureMechanismSections_EndPoints_DisplayName { Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx =================================================================== diff -u -r44f75ace98dd75de607002abd122dfe8310d5456 -rb19983374f4a64979bbb5167bcab288a921aa5e5 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx (.../Resources.resx) (revision 44f75ace98dd75de607002abd122dfe8310d5456) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx (.../Resources.resx) (revision b19983374f4a64979bbb5167bcab288a921aa5e5) @@ -208,7 +208,7 @@ eindpunten - + Vakindeling @@ -1247,4 +1247,7 @@ Waarden in het illustratiepunt + + Vakindeling waarmee de waterkering voor dit toetsspoor is geschematiseerd ten behoeve van de beoordeling. + \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/FailureMechanismSectionProperties.cs =================================================================== diff -u -r7aff630a7c9bb21707781ca2bd0f977d4715891d -rb19983374f4a64979bbb5167bcab288a921aa5e5 --- Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/FailureMechanismSectionProperties.cs (.../FailureMechanismSectionProperties.cs) (revision 7aff630a7c9bb21707781ca2bd0f977d4715891d) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/FailureMechanismSectionProperties.cs (.../FailureMechanismSectionProperties.cs) (revision b19983374f4a64979bbb5167bcab288a921aa5e5) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using Core.Common.Gui.PropertyBag; using Ringtoets.Common.Data.FailureMechanism; @@ -27,5 +28,22 @@ /// /// ViewModel of for properties panel. /// - public class FailureMechanismSectionProperties : ObjectProperties {} + public class FailureMechanismSectionProperties : ObjectProperties + { + /// + /// Creates a new instance of . + /// + /// The section to show the properties for. + /// Thrown when + /// is null. + public FailureMechanismSectionProperties(FailureMechanismSection section) + { + if (section == null) + { + throw new ArgumentNullException(nameof(section)); + } + + Data = section; + } + } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/FailureMechanismSectionsProperties.cs =================================================================== diff -u -r7aff630a7c9bb21707781ca2bd0f977d4715891d -rb19983374f4a64979bbb5167bcab288a921aa5e5 --- Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/FailureMechanismSectionsProperties.cs (.../FailureMechanismSectionsProperties.cs) (revision 7aff630a7c9bb21707781ca2bd0f977d4715891d) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/FailureMechanismSectionsProperties.cs (.../FailureMechanismSectionsProperties.cs) (revision b19983374f4a64979bbb5167bcab288a921aa5e5) @@ -21,8 +21,14 @@ using System; using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using Core.Common.Gui.Attributes; +using Core.Common.Gui.Converters; using Core.Common.Gui.PropertyBag; +using Core.Common.Util.Attributes; using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Forms.Properties; namespace Ringtoets.Common.Forms.PropertyClasses { @@ -46,5 +52,18 @@ Data = sections; } + + [PropertyOrder(1)] + [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_General))] + [ResourcesDisplayName(typeof(Resources), nameof(Resources.FailureMechanismSections_DisplayName))] + [ResourcesDescription(typeof(Resources), nameof(Resources.FailureMechanismSections_Description))] + [TypeConverter(typeof(ExpandableArrayConverter))] + public FailureMechanismSectionProperties[] Sections + { + get + { + return data.Select(section => new FailureMechanismSectionProperties(section)).ToArray(); + } + } } } \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/FailureMechanismSectionPropertiesTest.cs =================================================================== diff -u -r7aff630a7c9bb21707781ca2bd0f977d4715891d -rb19983374f4a64979bbb5167bcab288a921aa5e5 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/FailureMechanismSectionPropertiesTest.cs (.../FailureMechanismSectionPropertiesTest.cs) (revision 7aff630a7c9bb21707781ca2bd0f977d4715891d) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/FailureMechanismSectionPropertiesTest.cs (.../FailureMechanismSectionPropertiesTest.cs) (revision b19983374f4a64979bbb5167bcab288a921aa5e5) @@ -19,9 +19,11 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using Core.Common.Gui.PropertyBag; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Forms.PropertyClasses; namespace Ringtoets.Common.Forms.Test.PropertyClasses @@ -30,14 +32,28 @@ public class FailureMechanismSectionPropertiesTest { [Test] + public void Constructor_SectionNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new FailureMechanismSectionProperties(null); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("section", exception.ParamName); + } + + [Test] public void Constructor_ExpectedValues() { + // Setup + FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); + // Call - var properties = new FailureMechanismSectionProperties(); + var properties = new FailureMechanismSectionProperties(section); // Assert Assert.IsInstanceOf>(properties); - Assert.IsNull(properties.Data); + Assert.AreSame(section, properties.Data); } } } \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/FailureMechanismSectionsPropertiesTest.cs =================================================================== diff -u -r7aff630a7c9bb21707781ca2bd0f977d4715891d -rb19983374f4a64979bbb5167bcab288a921aa5e5 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/FailureMechanismSectionsPropertiesTest.cs (.../FailureMechanismSectionsPropertiesTest.cs) (revision 7aff630a7c9bb21707781ca2bd0f977d4715891d) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/FailureMechanismSectionsPropertiesTest.cs (.../FailureMechanismSectionsPropertiesTest.cs) (revision b19983374f4a64979bbb5167bcab288a921aa5e5) @@ -21,8 +21,11 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; +using Core.Common.Gui.Converters; using Core.Common.Gui.PropertyBag; +using Core.Common.TestUtil; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Forms.PropertyClasses; @@ -55,6 +58,32 @@ // Assert Assert.IsInstanceOf>>(properties); Assert.AreSame(sections, properties.Data); + + TestHelper.AssertTypeConverter( + nameof(FailureMechanismSectionsProperties.Sections)); + Assert.IsNotNull(properties.Sections); + Assert.AreEqual(sections.Count(), properties.Sections.Length); } + + [Test] + public void Constructor_Always_PropertiesHaveExpectedAttributesValues() + { + // Setup + IEnumerable sections = Enumerable.Empty(); + + // Call + var properties = new FailureMechanismSectionsProperties(sections); + + // Assert + PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); + Assert.AreEqual(1, dynamicProperties.Count); + + PropertyDescriptor nameProperty = dynamicProperties[0]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, + "Algemeen", + "Vakindeling", + "Vakindeling waarmee de waterkering voor dit toetsspoor is geschematiseerd ten behoeve van de beoordeling.", + true); + } } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs =================================================================== diff -u -r7aff630a7c9bb21707781ca2bd0f977d4715891d -rb19983374f4a64979bbb5167bcab288a921aa5e5 --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision 7aff630a7c9bb21707781ca2bd0f977d4715891d) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision b19983374f4a64979bbb5167bcab288a921aa5e5) @@ -486,7 +486,7 @@ yield return new ImportInfo { - Name = RingtoetsCommonFormsResources.FailureMechanism_Sections_DisplayName, + Name = RingtoetsCommonFormsResources.FailureMechanismSections_DisplayName, Category = RingtoetsCommonFormsResources.Ringtoets_Category, Image = RingtoetsCommonFormsResources.SectionsIcon, FileFilterGenerator = new FileFilterGenerator(RingtoetsCommonIOResources.Shape_file_filter_Extension, @@ -638,7 +638,7 @@ yield return new TreeNodeInfo { - Text = context => RingtoetsCommonFormsResources.FailureMechanism_Sections_DisplayName, + Text = context => RingtoetsCommonFormsResources.FailureMechanismSections_DisplayName, Image = context => RingtoetsCommonFormsResources.SectionsIcon, ForeColor = context => context.WrappedData.Sections.Any() ? Color.FromKnownColor(KnownColor.ControlText)