Index: Ringtoets/Integration/src/Ringtoets.Integration.Data/HydraulicBoundary/HydraulicBoundaryDatabase.cs =================================================================== diff -u -r71ad428b387b3f42b68b1759662de0f1a0c8da3c -r9745cf23c0ce16a076f08ce8ed726882c490c646 --- Ringtoets/Integration/src/Ringtoets.Integration.Data/HydraulicBoundary/HydraulicBoundaryDatabase.cs (.../HydraulicBoundaryDatabase.cs) (revision 71ad428b387b3f42b68b1759662de0f1a0c8da3c) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/HydraulicBoundary/HydraulicBoundaryDatabase.cs (.../HydraulicBoundaryDatabase.cs) (revision 9745cf23c0ce16a076f08ce8ed726882c490c646) @@ -19,10 +19,12 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using Core.Common.Base; + namespace Ringtoets.Integration.Data.HydraulicBoundary { - public class HydraulicBoundaryDatabase + public class HydraulicBoundaryDatabase : Observable { public string FilePath { get; set; } } -} +} \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -rc8848af0c6f8780634dcce2013e606f090da6577 -r9745cf23c0ce16a076f08ce8ed726882c490c646 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision c8848af0c6f8780634dcce2013e606f090da6577) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 9745cf23c0ce16a076f08ce8ed726882c490c646) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.17929 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -136,6 +136,24 @@ } /// + /// Looks up a localized string similar to Locatie van het HLCD database bestand.. + /// + internal static string HydraulicBoundaryDatabase_Name_Description { + get { + return ResourceManager.GetString("HydraulicBoundaryDatabase_Name_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to HLCD database. + /// + internal static string HydraulicBoundaryDatabase_Name_DisplayName { + get { + return ResourceManager.GetString("HydraulicBoundaryDatabase_Name_DisplayName", resourceCulture); + } + } + + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap PlaceholderIcon { Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.resx =================================================================== diff -u -r80ebf3911f46c8fde95702b7723e4457b4fd80ea -r9745cf23c0ce16a076f08ce8ed726882c490c646 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.resx (.../Resources.resx) (revision 80ebf3911f46c8fde95702b7723e4457b4fd80ea) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.resx (.../Resources.resx) (revision 9745cf23c0ce16a076f08ce8ed726882c490c646) @@ -145,4 +145,10 @@ Duintraject + + Locatie van het HLCD database bestand. + + + HLCD database + \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/HydraulicBoundaryDatabaseProperties.cs =================================================================== diff -u --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/HydraulicBoundaryDatabaseProperties.cs (revision 0) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/HydraulicBoundaryDatabaseProperties.cs (revision 9745cf23c0ce16a076f08ce8ed726882c490c646) @@ -0,0 +1,45 @@ +// 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 Core.Common.Gui.PropertyBag; +using Core.Common.Utils.Attributes; +using Ringtoets.Integration.Data.HydraulicBoundary; +using Ringtoets.Integration.Forms.Properties; + +namespace Ringtoets.Integration.Forms.PropertyClasses +{ + /// + /// ViewModel of for properties panel. + /// + public class HydraulicBoundaryDatabaseProperties : ObjectProperties + { + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Resources), "HydraulicBoundaryDatabase_Name_DisplayName")] + [ResourcesDescription(typeof(Resources), "HydraulicBoundaryDatabase_Name_Description")] + public string FilePath + { + get + { + return data.FilePath; + } + } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj =================================================================== diff -u -rc68064014494505f833de7749ee7b3d879f723d6 -r9745cf23c0ce16a076f08ce8ed726882c490c646 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj (.../Ringtoets.Integration.Forms.csproj) (revision c68064014494505f833de7749ee7b3d879f723d6) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj (.../Ringtoets.Integration.Forms.csproj) (revision 9745cf23c0ce16a076f08ce8ed726882c490c646) @@ -51,6 +51,7 @@ Resources.resx + UserControl Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsGuiPlugin.cs =================================================================== diff -u -r71ad428b387b3f42b68b1759662de0f1a0c8da3c -r9745cf23c0ce16a076f08ce8ed726882c490c646 --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsGuiPlugin.cs (.../RingtoetsGuiPlugin.cs) (revision 71ad428b387b3f42b68b1759662de0f1a0c8da3c) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsGuiPlugin.cs (.../RingtoetsGuiPlugin.cs) (revision 9745cf23c0ce16a076f08ce8ed726882c490c646) @@ -38,7 +38,6 @@ using Ringtoets.Integration.Data.Contribution; using Ringtoets.Integration.Data.HydraulicBoundary; using Ringtoets.Integration.Data.Placeholders; -using Ringtoets.Integration.Data.Properties; using Ringtoets.Integration.Forms.PropertyClasses; using Ringtoets.Integration.Forms.Views; using RingtoetsDataResources = Ringtoets.Integration.Data.Properties.Resources; @@ -61,17 +60,24 @@ } } + /// + /// Returns all instances provided for data of . + /// public override IEnumerable GetPropertyInfos() { yield return new PropertyInfo(); + yield return new PropertyInfo(); } + /// + /// Returns all instances provided for data of . + /// public override IEnumerable GetViewInfos() { yield return new ViewInfo { - GetViewName = (v,o) => Resources.FailureMechanismContribution_DisplayName, - Image = Forms.Properties.Resources.GenericInputOutputIcon, + GetViewName = (v, o) => RingtoetsDataResources.FailureMechanismContribution_DisplayName, + Image = RingtoetsFormsResources.GenericInputOutputIcon, CloseForData = (v, o) => { var assessmentSection = o as AssessmentSectionBase; @@ -80,6 +86,11 @@ }; } + /// + /// Gets the child data instances that have definitions of some parent data object. + /// + /// The parent data object. + /// Sequence of child data. public override IEnumerable GetChildDataWithViewDefinitions(object dataObject) { var assessmentSection = dataObject as AssessmentSectionBase; @@ -89,6 +100,9 @@ } } + /// + /// Returns all instances provided for data of . + /// public override IEnumerable GetTreeNodeInfos() { yield return new TreeNodeInfo @@ -337,19 +351,19 @@ } # endregion - + #region HydraulicBoundaryDatabase private ContextMenuStrip HydraulicBoundaryDatabaseContextMenuStrip(HydraulicBoundaryDatabase nodeData, object parentData, TreeViewControl treeViewControl) { var connectionItem = new StrictContextMenuItem( - RingtoetsCommonFormsResources.HydraulicBoundaryDatabase_Connect, - RingtoetsCommonFormsResources.HydraulicBoundaryDatabase_Connect_ToolTip, + RingtoetsCommonFormsResources.HydraulicBoundaryDatabase_Connect, + RingtoetsCommonFormsResources.HydraulicBoundaryDatabase_Connect_ToolTip, RingtoetsCommonFormsResources.DatabaseIcon, (sender, args) => SelectDatabaseFile(nodeData)); var toetsPeilItem = new StrictContextMenuItem( - RingtoetsCommonFormsResources.Toetspeil_Calculate, - RingtoetsCommonFormsResources.Toetspeil_Calculate_ToolTip, + RingtoetsCommonFormsResources.Toetspeil_Calculate, + RingtoetsCommonFormsResources.Toetspeil_Calculate_ToolTip, GetFolderIcon(TreeFolderCategory.General), null); return Gui.Get(nodeData, treeViewControl) @@ -410,10 +424,7 @@ } } - private static void ShowCleanDialog() - { - - } + private static void ShowCleanDialog() {} #endregion } Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/DikeAssessmentSectionPropertiesTest.cs =================================================================== diff -u -r0c64d8a6c718c0aa67403a16c94dd0c10f862455 -r9745cf23c0ce16a076f08ce8ed726882c490c646 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/DikeAssessmentSectionPropertiesTest.cs (.../DikeAssessmentSectionPropertiesTest.cs) (revision 0c64d8a6c718c0aa67403a16c94dd0c10f862455) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/DikeAssessmentSectionPropertiesTest.cs (.../DikeAssessmentSectionPropertiesTest.cs) (revision 9745cf23c0ce16a076f08ce8ed726882c490c646) @@ -1,11 +1,7 @@ using Core.Common.Base; -using Core.Common.Gui; using Core.Common.Gui.PropertyBag; - using NUnit.Framework; - using Rhino.Mocks; - using Ringtoets.Integration.Data; using Ringtoets.Integration.Forms.PropertyClasses; Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/HydraulicBoundaryDatabasePropertiesTest.cs =================================================================== diff -u --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/HydraulicBoundaryDatabasePropertiesTest.cs (revision 0) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/HydraulicBoundaryDatabasePropertiesTest.cs (revision 9745cf23c0ce16a076f08ce8ed726882c490c646) @@ -0,0 +1,40 @@ +using Core.Common.Gui.PropertyBag; +using NUnit.Framework; +using Ringtoets.Integration.Data.HydraulicBoundary; +using Ringtoets.Integration.Forms.PropertyClasses; + +namespace Ringtoets.Integration.Forms.Test.PropertyClasses +{ + [TestFixture] + public class HydraulicBoundaryDatabasePropertiesTest + { + [Test] + public void DefaultConstructor_ExpectedValues() + { + // Call + var properties = new HydraulicBoundaryDatabaseProperties(); + + // Assert + Assert.IsInstanceOf>(properties); + Assert.IsNull(properties.Data); + } + + [Test] + public void GetProperties_WithData_ReturnExpectedValues() + { + // Setup + var hydraulicDatabase = new HydraulicBoundaryDatabase + { + FilePath = "Test" + }; + + var properties = new HydraulicBoundaryDatabaseProperties + { + Data = hydraulicDatabase + }; + + // Call & Assert + Assert.AreEqual(hydraulicDatabase.FilePath, properties.FilePath); + } + } +} \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj =================================================================== diff -u -rf5930f39b15d4faf190e6e7c26f253060ba4829a -r9745cf23c0ce16a076f08ce8ed726882c490c646 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj (.../Ringtoets.Integration.Forms.Test.csproj) (revision f5930f39b15d4faf190e6e7c26f253060ba4829a) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj (.../Ringtoets.Integration.Forms.Test.csproj) (revision 9745cf23c0ce16a076f08ce8ed726882c490c646) @@ -58,6 +58,7 @@ + Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsGuiPluginTest.cs =================================================================== diff -u -r3bb288d253e85ca28ccfcfd2cb213f57a9b0d310 -r9745cf23c0ce16a076f08ce8ed726882c490c646 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsGuiPluginTest.cs (.../RingtoetsGuiPluginTest.cs) (revision 3bb288d253e85ca28ccfcfd2cb213f57a9b0d310) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsGuiPluginTest.cs (.../RingtoetsGuiPluginTest.cs) (revision 9745cf23c0ce16a076f08ce8ed726882c490c646) @@ -5,7 +5,6 @@ using Core.Common.Gui; using Core.Common.Gui.ContextMenu; using Core.Common.Gui.Plugin; - using NUnit.Framework; using Rhino.Mocks; using Ringtoets.Common.Forms.PresentationObjects; @@ -44,13 +43,19 @@ PropertyInfo[] propertyInfos = guiPlugin.GetPropertyInfos().ToArray(); // assert - Assert.AreEqual(1, propertyInfos.Length); + Assert.AreEqual(2, propertyInfos.Length); var assessmentSectionProperties = propertyInfos.Single(pi => pi.DataType == typeof(AssessmentSectionBase)); Assert.AreEqual(typeof(AssessmentSectionBaseProperties), assessmentSectionProperties.PropertyObjectType); Assert.IsNull(assessmentSectionProperties.AdditionalDataCheck); Assert.IsNull(assessmentSectionProperties.GetObjectPropertiesData); Assert.IsNull(assessmentSectionProperties.AfterCreate); + + var hydraulicBoundaryDatabase = propertyInfos.Single(pi => pi.DataType == typeof(HydraulicBoundaryDatabase)); + Assert.AreEqual(typeof(HydraulicBoundaryDatabaseProperties), hydraulicBoundaryDatabase.PropertyObjectType); + Assert.IsNull(hydraulicBoundaryDatabase.AdditionalDataCheck); + Assert.IsNull(hydraulicBoundaryDatabase.GetObjectPropertiesData); + Assert.IsNull(hydraulicBoundaryDatabase.AfterCreate); } } @@ -101,7 +106,10 @@ var childrenWithViewDefinitions = guiPlugin.GetChildDataWithViewDefinitions(assessmentSectionBase); // Assert - CollectionAssert.AreEqual(new[] { assessmentSectionBase.FailureMechanismContribution }, childrenWithViewDefinitions); + CollectionAssert.AreEqual(new[] + { + assessmentSectionBase.FailureMechanismContribution + }, childrenWithViewDefinitions); mocks.VerifyAll(); }