Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -rc68064014494505f833de7749ee7b3d879f723d6 -r5e0721f34fbf44e8aad51cfd4ff6abc8aa061494 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision c68064014494505f833de7749ee7b3d879f723d6) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 5e0721f34fbf44e8aad51cfd4ff6abc8aa061494) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// Runtime Version:4.0.30319.17929 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -145,6 +145,26 @@ } /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap DatabaseErrorIcon { + get { + object obj = ResourceManager.GetObject("DatabaseErrorIcon", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap DatabaseIcon { + get { + object obj = ResourceManager.GetObject("DatabaseIcon", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// /// Looks up a localized string similar to Invoer. /// public static string FailureMechanism_Inputs_DisplayName { @@ -191,6 +211,24 @@ } /// + /// Looks up a localized string similar to Koppel aan database. + /// + public static string HydraulicBoundaryDatabase_Connect { + get { + return ResourceManager.GetString("HydraulicBoundaryDatabase_Connect", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Koppelen aan de HR database. + /// + public static string HydraulicBoundaryDatabase_Connect_ToolTip { + get { + return ResourceManager.GetString("HydraulicBoundaryDatabase_Connect_ToolTip", resourceCulture); + } + } + + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// public static System.Drawing.Bitmap InputFolderIcon { @@ -220,6 +258,42 @@ } /// + /// Looks up a localized string similar to HLCD database. + /// + public static string SelectDatabaseFile_FilterName { + get { + return ResourceManager.GetString("SelectDatabaseFile_FilterName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Selecteer database. + /// + public static string SelectDatabaseFile_Title { + get { + return ResourceManager.GetString("SelectDatabaseFile_Title", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Toetspeilen berekenen. + /// + public static string Toetspeil_Calculate { + get { + return ResourceManager.GetString("Toetspeil_Calculate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bereken de toetspeilen. + /// + public static string Toetspeil_Calculate_ToolTip { + get { + return ResourceManager.GetString("Toetspeil_Calculate_ToolTip", resourceCulture); + } + } + + /// /// Looks up a localized string similar to &Valideren. /// public static string Validate { Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx =================================================================== diff -u -rc68064014494505f833de7749ee7b3d879f723d6 -r5e0721f34fbf44e8aad51cfd4ff6abc8aa061494 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx (.../Resources.resx) (revision c68064014494505f833de7749ee7b3d879f723d6) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx (.../Resources.resx) (revision 5e0721f34fbf44e8aad51cfd4ff6abc8aa061494) @@ -187,4 +187,28 @@ Valideer de invoer voor deze berekening. + + ..\Resources\database--exclamation.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\database.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Koppel aan database + + + Koppelen aan de HR database + + + Toetspeilen berekenen + + + Bereken de toetspeilen + + + Selecteer database + + + HLCD database + \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Resources/database--exclamation.png =================================================================== diff -u Binary files differ Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Resources/database.png =================================================================== diff -u Binary files differ Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj =================================================================== diff -u -rc68064014494505f833de7749ee7b3d879f723d6 -r5e0721f34fbf44e8aad51cfd4ff6abc8aa061494 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj (.../Ringtoets.Common.Forms.csproj) (revision c68064014494505f833de7749ee7b3d879f723d6) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj (.../Ringtoets.Common.Forms.csproj) (revision 5e0721f34fbf44e8aad51cfd4ff6abc8aa061494) @@ -113,6 +113,8 @@ + + Index: Ringtoets/Integration/src/Ringtoets.Integration.Data/AssessmentSectionBase.cs =================================================================== diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -r5e0721f34fbf44e8aad51cfd4ff6abc8aa061494 --- Ringtoets/Integration/src/Ringtoets.Integration.Data/AssessmentSectionBase.cs (.../AssessmentSectionBase.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/AssessmentSectionBase.cs (.../AssessmentSectionBase.cs) (revision 5e0721f34fbf44e8aad51cfd4ff6abc8aa061494) @@ -26,6 +26,7 @@ using Ringtoets.Common.Data; using Ringtoets.Common.Placeholder; using Ringtoets.Integration.Data.Contribution; +using Ringtoets.Integration.Data.HydraulicBoundary; using Ringtoets.Integration.Data.Properties; namespace Ringtoets.Integration.Data @@ -42,7 +43,7 @@ { Name = ""; ReferenceLine = new InputPlaceholder(Resources.ReferenceLine_DisplayName); - HydraulicBoundaryDatabase = new InputPlaceholder(Resources.HydraulicBoundaryDatabase_DisplayName); + HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); } /// @@ -63,7 +64,7 @@ /// /// Gets or sets the hydraulic boundary database. /// - public InputPlaceholder HydraulicBoundaryDatabase { get; private set; } + public HydraulicBoundaryDatabase HydraulicBoundaryDatabase { get; private set; } /// /// Gets the failure mechanisms corresponding to the assessment section. Index: Ringtoets/Integration/src/Ringtoets.Integration.Data/HydraulicBoundary/HydraulicBoundaryDatabase.cs =================================================================== diff -u --- Ringtoets/Integration/src/Ringtoets.Integration.Data/HydraulicBoundary/HydraulicBoundaryDatabase.cs (revision 0) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/HydraulicBoundary/HydraulicBoundaryDatabase.cs (revision 5e0721f34fbf44e8aad51cfd4ff6abc8aa061494) @@ -0,0 +1,28 @@ +// 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. + +namespace Ringtoets.Integration.Data.HydraulicBoundary +{ + public class HydraulicBoundaryDatabase + { + public string FileName { get; set; } + } +} Index: Ringtoets/Integration/src/Ringtoets.Integration.Data/Properties/Resources.Designer.cs =================================================================== diff -u -rc8848af0c6f8780634dcce2013e606f090da6577 -r5e0721f34fbf44e8aad51cfd4ff6abc8aa061494 --- Ringtoets/Integration/src/Ringtoets.Integration.Data/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision c8848af0c6f8780634dcce2013e606f090da6577) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 5e0721f34fbf44e8aad51cfd4ff6abc8aa061494) @@ -171,7 +171,7 @@ } /// - /// Looks up a localized string similar to HR locatiedatabase. + /// Looks up a localized string similar to Hydraulische randvoorwaarden. /// public static string HydraulicBoundaryDatabase_DisplayName { get { Index: Ringtoets/Integration/src/Ringtoets.Integration.Data/Properties/Resources.resx =================================================================== diff -u -r83aacc6578d82137751a7d28f691e8b3d02312f1 -r5e0721f34fbf44e8aad51cfd4ff6abc8aa061494 --- Ringtoets/Integration/src/Ringtoets.Integration.Data/Properties/Resources.resx (.../Resources.resx) (revision 83aacc6578d82137751a7d28f691e8b3d02312f1) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/Properties/Resources.resx (.../Resources.resx) (revision 5e0721f34fbf44e8aad51cfd4ff6abc8aa061494) @@ -127,7 +127,7 @@ Faalkansverdeling - HR locatiedatabase + Hydraulische randvoorwaarden Duinen - Erosie Index: Ringtoets/Integration/src/Ringtoets.Integration.Data/Ringtoets.Integration.Data.csproj =================================================================== diff -u -rc8848af0c6f8780634dcce2013e606f090da6577 -r5e0721f34fbf44e8aad51cfd4ff6abc8aa061494 --- Ringtoets/Integration/src/Ringtoets.Integration.Data/Ringtoets.Integration.Data.csproj (.../Ringtoets.Integration.Data.csproj) (revision c8848af0c6f8780634dcce2013e606f090da6577) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/Ringtoets.Integration.Data.csproj (.../Ringtoets.Integration.Data.csproj) (revision 5e0721f34fbf44e8aad51cfd4ff6abc8aa061494) @@ -46,6 +46,7 @@ + Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsGuiPlugin.cs =================================================================== diff -u -r67980a5c3c5cb71c185278e849b123e7f92990eb -r5e0721f34fbf44e8aad51cfd4ff6abc8aa061494 --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsGuiPlugin.cs (.../RingtoetsGuiPlugin.cs) (revision 67980a5c3c5cb71c185278e849b123e7f92990eb) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsGuiPlugin.cs (.../RingtoetsGuiPlugin.cs) (revision 5e0721f34fbf44e8aad51cfd4ff6abc8aa061494) @@ -34,6 +34,7 @@ using Ringtoets.Common.Placeholder; using Ringtoets.Integration.Data; 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; @@ -135,6 +136,13 @@ .AddExportItem() .Build() }; + + yield return new TreeNodeInfo + { + Text = hydraulicBoundaryDatabase => RingtoetsDataResources.HydraulicBoundaryDatabase_DisplayName, + Image = hydraulicBoundaryDatabase => RingtoetsFormsResources.GenericInputOutputIcon, + ContextMenuStrip = HydraulicBoundaryDatabaseContextMenuStrip + }; } # region AssessmentSectionBase @@ -326,5 +334,53 @@ } # endregion + + #region HydraulicBoundaryDatabase + + private ContextMenuStrip HydraulicBoundaryDatabaseContextMenuStrip(HydraulicBoundaryDatabase nodeData, object parentData, TreeViewControl treeViewControl) + { + var connectionItem = new StrictContextMenuItem( + RingtoetsCommonFormsResources.HydraulicBoundaryDatabase_Connect, + RingtoetsCommonFormsResources.HydraulicBoundaryDatabase_Connect_ToolTip, + RingtoetsCommonFormsResources.DatabaseIcon, (sender, args) => SelectDatabaseFile(nodeData)); + + var toetsPeilItem = new StrictContextMenuItem( + RingtoetsCommonFormsResources.Toetspeil_Calculate, + RingtoetsCommonFormsResources.Toetspeil_Calculate_ToolTip, + GetFolderIcon(TreeFolderCategory.General), null); + + return Gui.Get(nodeData, treeViewControl) + .AddOpenItem() + .AddSeparator() + .AddCustomItem(connectionItem) + .AddImportItem() + .AddExportItem() + .AddSeparator() + .AddCustomItem(toetsPeilItem) + .AddSeparator() + .AddPropertiesItem() + .Build(); + } + + private void SelectDatabaseFile(HydraulicBoundaryDatabase nodeData) + { + var windowTitle = RingtoetsCommonFormsResources.SelectDatabaseFile_Title; + using (var dialog = new OpenFileDialog + { + Filter = string.Format("{0} (*.sqlite)|*.sqlite", RingtoetsCommonFormsResources.SelectDatabaseFile_FilterName), + Multiselect = false, + Title = windowTitle, + RestoreDirectory = true, + CheckFileExists = true, + }) + { + if (dialog.ShowDialog(Gui.MainWindow) == DialogResult.OK) + { + nodeData.FileName = dialog.FileName; + } + } + } + + #endregion } } \ No newline at end of file