Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/BackgroundMapDataSelectionDialog.Designer.cs
===================================================================
diff -u
--- Ringtoets/Integration/src/Ringtoets.Integration.Forms/BackgroundMapDataSelectionDialog.Designer.cs (revision 0)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/BackgroundMapDataSelectionDialog.Designer.cs (revision dacf55a39070dff712ae107c927131be7e785bf7)
@@ -0,0 +1,53 @@
+// 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.Forms
+{
+ partial class BackgroundMapDataSelectionDialog
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BackgroundMapDataSelectionDialog));
+ this.SuspendLayout();
+ //
+ // BackgroundMapDataSelectionDialog
+ //
+ resources.ApplyResources(this, "$this");
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Name = "BackgroundMapDataSelectionDialog";
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/BackgroundMapDataSelectionDialog.cs
===================================================================
diff -u
--- Ringtoets/Integration/src/Ringtoets.Integration.Forms/BackgroundMapDataSelectionDialog.cs (revision 0)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/BackgroundMapDataSelectionDialog.cs (revision dacf55a39070dff712ae107c927131be7e785bf7)
@@ -0,0 +1,67 @@
+// 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;
+using System.Windows.Forms;
+using Core.Common.Controls.DataGrid;
+using Core.Common.Controls.Dialogs;
+using Core.Components.Gis.Data;
+using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources;
+
+namespace Ringtoets.Integration.Forms
+{
+ ///
+ /// A dialog which allows the user to make a selection from a given set of background layers. Upon
+ /// closing of the dialog, the selected background layer can be obtained.
+ ///
+ public partial class BackgroundMapDataSelectionDialog : DialogBase
+ {
+ ///
+ /// Creates a new instance of .
+ ///
+ /// The parent of the dialog.
+ /// Thrown when is null.
+ public BackgroundMapDataSelectionDialog(IWin32Window dialogParent)
+ : base(dialogParent, RingtoetsCommonFormsResources.SelectionDialogIcon, 500, 350)
+ {
+ InitializeComponent();
+ }
+
+ ///
+ /// Gets the from the selected row in the .
+ ///
+ public object SelectedMapData { get; private set; }
+
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ components?.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ protected override Button GetCancelButton()
+ {
+ return null;
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/BackgroundMapDataSelectionDialog.resx
===================================================================
diff -u
--- Ringtoets/Integration/src/Ringtoets.Integration.Forms/BackgroundMapDataSelectionDialog.resx (revision 0)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/BackgroundMapDataSelectionDialog.resx (revision dacf55a39070dff712ae107c927131be7e785bf7)
@@ -0,0 +1,139 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 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
+
+
+ True
+
+
+
+ 6, 13
+
+
+ 284, 262
+
+
+ Selecteer achtergrondkaart
+
+
+ BackgroundMapDataSelectionDialog
+
+
+ System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/ReferenceLineMetaSelectionDialog.cs
===================================================================
diff -u -rb2b9fdf365e70928a05c57966eeed30d9050e528 -rdacf55a39070dff712ae107c927131be7e785bf7
--- Ringtoets/Integration/src/Ringtoets.Integration.Forms/ReferenceLineMetaSelectionDialog.cs (.../ReferenceLineMetaSelectionDialog.cs) (revision b2b9fdf365e70928a05c57966eeed30d9050e528)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/ReferenceLineMetaSelectionDialog.cs (.../ReferenceLineMetaSelectionDialog.cs) (revision dacf55a39070dff712ae107c927131be7e785bf7)
@@ -44,6 +44,8 @@
///
/// The parent of the dialog.
/// A list of the user can select.
+ /// Thrown when or
+ /// is null.
public ReferenceLineMetaSelectionDialog(IWin32Window dialogParent, IEnumerable referenceLineMetas)
: base(dialogParent, RingtoetsCommonFormsResources.SelectionDialogIcon, 372, 350)
{
Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj
===================================================================
diff -u -r51ddda3656dd349582d7790169a34080d79da68a -rdacf55a39070dff712ae107c927131be7e785bf7
--- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj (.../Ringtoets.Integration.Forms.csproj) (revision 51ddda3656dd349582d7790169a34080d79da68a)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj (.../Ringtoets.Integration.Forms.csproj) (revision dacf55a39070dff712ae107c927131be7e785bf7)
@@ -45,6 +45,12 @@
Properties\GlobalAssembly.cs
+
+ Form
+
+
+ BackgroundMapDataSelectionDialog.cs
+
@@ -216,11 +222,6 @@
Ringtoets.GrassCoverErosionOutwards.DataFalse
-
- {41b829c1-630f-40b0-8bee-b1c4c94ec8c4}
- Ringtoets.GrassCoverErosionOutwards.Forms
- False
- {1C0017D8-35B5-4CA0-8FC7-A83F46DBDC99}Ringtoets.HeightStructures.Data
@@ -238,6 +239,9 @@
+
+ BackgroundMapDataSelectionDialog.cs
+ PublicResXFileCodeGeneratorDesigner
Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/BackgroundMapDataSelectionDialogTest.cs
===================================================================
diff -u
--- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/BackgroundMapDataSelectionDialogTest.cs (revision 0)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/BackgroundMapDataSelectionDialogTest.cs (revision dacf55a39070dff712ae107c927131be7e785bf7)
@@ -0,0 +1,90 @@
+// 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;
+using System.Drawing;
+using System.Windows.Forms;
+using Core.Common.Controls.Dialogs;
+using Core.Common.TestUtil;
+using NUnit.Framework;
+using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources;
+
+namespace Ringtoets.Integration.Forms.Test
+{
+ [TestFixture]
+ public class BackgroundMapDataSelectionDialogTest
+ {
+ [Test]
+ public void Constructor_WithoutParent_ThrowsArgumentNullException()
+ {
+ // Call
+ TestDelegate test = () => new BackgroundMapDataSelectionDialog(null);
+
+ // Assert
+ string parameter = Assert.Throws(test).ParamName;
+ Assert.AreEqual("dialogParent", parameter);
+ }
+
+ [Test]
+ public void Constructor_WithParent_DefaultProperties()
+ {
+ // Setup
+ using (var dialogParent = new Form())
+ {
+ // Call
+ using (var dialog = new BackgroundMapDataSelectionDialog(dialogParent))
+ {
+ // Assert
+ Assert.IsInstanceOf(dialog);
+ Assert.AreEqual(@"Selecteer achtergrondkaart", dialog.Text);
+ Assert.IsNull(dialog.SelectedMapData);
+
+ Icon icon = BitmapToIcon(RingtoetsCommonFormsResources.SelectionDialogIcon);
+ Bitmap expectedImage = icon.ToBitmap();
+ Bitmap actualImage = dialog.Icon.ToBitmap();
+ TestHelper.AssertImagesAreEqual(expectedImage, actualImage);
+ }
+ }
+ }
+
+ [Test]
+ public void OnLoad_Always_MinimumSizeSet()
+ {
+ // Setup
+ using (var dialogParent = new Form())
+ using (var dialog = new BackgroundMapDataSelectionDialog(dialogParent))
+ {
+ // Call
+ dialog.Show();
+
+ // Assert
+
+ Assert.AreEqual(500, dialog.MinimumSize.Width);
+ Assert.AreEqual(350, dialog.MinimumSize.Height);
+ }
+ }
+
+ private static Icon BitmapToIcon(Bitmap icon)
+ {
+ return Icon.FromHandle(icon.GetHicon());
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj
===================================================================
diff -u -r51ddda3656dd349582d7790169a34080d79da68a -rdacf55a39070dff712ae107c927131be7e785bf7
--- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj (.../Ringtoets.Integration.Forms.Test.csproj) (revision 51ddda3656dd349582d7790169a34080d79da68a)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj (.../Ringtoets.Integration.Forms.Test.csproj) (revision dacf55a39070dff712ae107c927131be7e785bf7)
@@ -64,6 +64,7 @@
Properties\GlobalAssembly.cs
+