Index: Core/Plugins/test/Core.Plugins.ProjectExplorer.Test/RibbonTest.cs
===================================================================
diff -u -r151bab16a7ebc1bffc0621ab56c6dc219db1e90f -r75c007324755a9f899f7fc5639ff873311343bdc
--- Core/Plugins/test/Core.Plugins.ProjectExplorer.Test/RibbonTest.cs (.../RibbonTest.cs) (revision 151bab16a7ebc1bffc0621ab56c6dc219db1e90f)
+++ Core/Plugins/test/Core.Plugins.ProjectExplorer.Test/RibbonTest.cs (.../RibbonTest.cs) (revision 75c007324755a9f899f7fc5639ff873311343bdc)
@@ -93,6 +93,7 @@
// Assert
CollectionAssert.AreEqual(new[] { command }, result);
+ mocks.VerifyAll();
}
[Test]
@@ -122,6 +123,7 @@
// Assert
Assert.AreEqual(isChecked, toggleProjectExplorerButton.IsChecked);
+ mocks.VerifyAll();
}
[Test]
Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Commands/AddAssessmentSectionCommand.cs
===================================================================
diff -u
--- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Commands/AddAssessmentSectionCommand.cs (revision 0)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Commands/AddAssessmentSectionCommand.cs (revision 75c007324755a9f899f7fc5639ff873311343bdc)
@@ -0,0 +1,69 @@
+// 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 Core.Common.Controls.Commands;
+
+namespace Ringtoets.Integration.Forms.Commands
+{
+ ///
+ /// This class describes commands which are used to execute in the GUI.
+ ///
+ public class AddAssessmentSectionCommand : ICommand
+ {
+ private readonly IAssessmentSectionFromFileCommandHandler assessmentSectionFromFileCommandHandler;
+
+ ///
+ /// Creates a new instance of .
+ ///
+ /// The to execute.
+ /// Throw when is null.
+ public AddAssessmentSectionCommand(IAssessmentSectionFromFileCommandHandler assessmentSectionFromFileCommandHandler)
+ {
+ if (assessmentSectionFromFileCommandHandler == null)
+ {
+ throw new ArgumentNullException("assessmentSectionFromFileCommandHandler");
+ }
+ this.assessmentSectionFromFileCommandHandler = assessmentSectionFromFileCommandHandler;
+ }
+
+ public bool Enabled
+ {
+ get
+ {
+ return true;
+ }
+ }
+
+ public bool Checked
+ {
+ get
+ {
+ return true;
+ }
+ }
+
+ public void Execute(params object[] arguments)
+ {
+ assessmentSectionFromFileCommandHandler.CreateAssessmentSectionFromFile();
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Commands/AssessmentSectionFromFileCommandHandler.cs
===================================================================
diff -u -r50b203a8d5c805fc548fb6b92c70a847190da6a5 -r75c007324755a9f899f7fc5639ff873311343bdc
--- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Commands/AssessmentSectionFromFileCommandHandler.cs (.../AssessmentSectionFromFileCommandHandler.cs) (revision 50b203a8d5c805fc548fb6b92c70a847190da6a5)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Commands/AssessmentSectionFromFileCommandHandler.cs (.../AssessmentSectionFromFileCommandHandler.cs) (revision 75c007324755a9f899f7fc5639ff873311343bdc)
@@ -23,12 +23,12 @@
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
+using Core.Common.Base.Data;
using Core.Common.Gui;
using Core.Common.Gui.Forms.ViewHost;
using Core.Common.IO.Exceptions;
using log4net;
using Ringtoets.Common.Data.AssessmentSection;
-using Ringtoets.Common.Data.FailureMechanism;
using Ringtoets.Common.Forms.Helpers;
using Ringtoets.Common.IO;
using Ringtoets.Common.IO.Exceptions;
@@ -39,9 +39,9 @@
namespace Ringtoets.Integration.Forms.Commands
{
///
- /// This class provides concrete implementation for .
+ /// This class is responsible for adding an from a predefined location.
///
- public class AssessmentSectionFromFileCommandHandler
+ public class AssessmentSectionFromFileCommandHandler : IAssessmentSectionFromFileCommandHandler
{
private static readonly ILog log = LogManager.GetLogger(typeof(AssessmentSectionFromFileCommandHandler));
private readonly string shapeFileDirectory = RingtoetsSettingsHelper.GetCommonDocumentsRingtoetsShapeFileDirectory();
@@ -77,9 +77,6 @@
this.viewController = viewController;
}
- ///
- /// Creates an
- ///
public void CreateAssessmentSectionFromFile()
{
if (!TryValidate())
Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Commands/IAssessmentSectionFromFileCommandHandler.cs
===================================================================
diff -u
--- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Commands/IAssessmentSectionFromFileCommandHandler.cs (revision 0)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Commands/IAssessmentSectionFromFileCommandHandler.cs (revision 75c007324755a9f899f7fc5639ff873311343bdc)
@@ -0,0 +1,39 @@
+// 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.Base.Data;
+using Core.Common.Gui;
+using Ringtoets.Integration.Data;
+
+namespace Ringtoets.Integration.Forms.Commands
+{
+ ///
+ /// Interface for exposing command related to adding an to an in the .
+ ///
+ public interface IAssessmentSectionFromFileCommandHandler
+ {
+ ///
+ /// Displays a dialog of objects.
+ /// If an is selected to import, it is added to the in the .
+ ///
+ void CreateAssessmentSectionFromFile();
+ }
+}
\ No newline at end of file
Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj
===================================================================
diff -u -rbc7cd9cbf90d04580e6b3542c56edc590867c43a -r75c007324755a9f899f7fc5639ff873311343bdc
--- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj (.../Ringtoets.Integration.Forms.csproj) (revision bc7cd9cbf90d04580e6b3542c56edc590867c43a)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj (.../Ringtoets.Integration.Forms.csproj) (revision 75c007324755a9f899f7fc5639ff873311343bdc)
@@ -49,7 +49,9 @@
Properties\GlobalAssembly.cs
+
+
Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.Designer.cs
===================================================================
diff -u -ra1ec5faebf7ccf8e67fa34a2b73cd1063ab48840 -r75c007324755a9f899f7fc5639ff873311343bdc
--- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision a1ec5faebf7ccf8e67fa34a2b73cd1063ab48840)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 75c007324755a9f899f7fc5639ff873311343bdc)
@@ -198,5 +198,23 @@
"d_0_", resourceCulture);
}
}
+
+ ///
+ /// Looks up a localized string similar to Nieuw.
+ ///
+ public static string RingtoetsRibbon_GroupBox_New {
+ get {
+ return ResourceManager.GetString("RingtoetsRibbon_GroupBox_New", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Start.
+ ///
+ public static string RingtoetsRibbon_TabItem_View {
+ get {
+ return ResourceManager.GetString("RingtoetsRibbon_TabItem_View", resourceCulture);
+ }
+ }
}
}
Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.resx
===================================================================
diff -u -ra1ec5faebf7ccf8e67fa34a2b73cd1063ab48840 -r75c007324755a9f899f7fc5639ff873311343bdc
--- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.resx (.../Resources.resx) (revision a1ec5faebf7ccf8e67fa34a2b73cd1063ab48840)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.resx (.../Resources.resx) (revision 75c007324755a9f899f7fc5639ff873311343bdc)
@@ -163,4 +163,10 @@
Opmerkingen
+
+ Nieuw
+
+
+ Start
+
\ No newline at end of file
Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs
===================================================================
diff -u -r2227f1d3a31b15a6d05c5385898d5da4b79dcdea -r75c007324755a9f899f7fc5639ff873311343bdc
--- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision 2227f1d3a31b15a6d05c5385898d5da4b79dcdea)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision 75c007324755a9f899f7fc5639ff873311343bdc)
@@ -42,7 +42,6 @@
using Ringtoets.Common.Data.Contribution;
using Ringtoets.Common.Data.FailureMechanism;
using Ringtoets.Common.Data.Probability;
-using Ringtoets.Common.Forms.Helpers;
using Ringtoets.Common.Forms.PresentationObjects;
using Ringtoets.Common.Forms.PropertyClasses;
using Ringtoets.Common.Forms.TreeNodeInfos;
@@ -200,13 +199,15 @@
#endregion
- private AssessmentSectionFromFileCommandHandler assessmentSectionFromFileCommandHandler;
+ private RingtoetsRibbon ribbonCommandHandler;
+ private IAssessmentSectionFromFileCommandHandler assessmentSectionFromFileCommandHandler;
+
public override IRibbonCommandHandler RibbonCommandHandler
{
get
{
- return new RingtoetsRibbon();
+ return ribbonCommandHandler;
}
}
@@ -233,7 +234,11 @@
throw new InvalidOperationException("Gui cannot be null");
}
assessmentSectionFromFileCommandHandler = new AssessmentSectionFromFileCommandHandler(Gui.MainWindow, Gui, Gui.DocumentViewController);
-
+
+ ribbonCommandHandler = new RingtoetsRibbon
+ {
+ AddAssessmentSectionButtonCommand = new AddAssessmentSectionCommand(assessmentSectionFromFileCommandHandler)
+ };
}
///
@@ -703,12 +708,7 @@
#endregion
#region AssessmentSection
-
- private static string GetUniqueForAssessmentSectionName(IEnumerable assessmentSections, string baseName)
- {
- return NamingHelper.GetUniqueName(assessmentSections, baseName, a => a.Name);
- }
-
+
private object[] AssessmentSectionChildNodeObjects(IAssessmentSection nodeData)
{
var childNodes = new List