Index: Demo/Ringtoets/src/Demo.Ringtoets/Commands/AddNewDemoAssessmentSectionCommand.cs
===================================================================
diff -u -r953e0d229cccbaea58fd9e9ef582504b9fa0cf7c -re949ab20d487bf97ab1cedf2b360fdb1f948419f
--- Demo/Ringtoets/src/Demo.Ringtoets/Commands/AddNewDemoAssessmentSectionCommand.cs (.../AddNewDemoAssessmentSectionCommand.cs) (revision 953e0d229cccbaea58fd9e9ef582504b9fa0cf7c)
+++ Demo/Ringtoets/src/Demo.Ringtoets/Commands/AddNewDemoAssessmentSectionCommand.cs (.../AddNewDemoAssessmentSectionCommand.cs) (revision e949ab20d487bf97ab1cedf2b360fdb1f948419f)
@@ -116,7 +116,7 @@
"traject_6-3.shx"))
{
var importer = new ReferenceLineImporter(demoAssessmentSection.ReferenceLine,
- new ReferenceLineReplacementHandler(demoAssessmentSection, viewCommands),
+ new ReferenceLineUpdateHandler(demoAssessmentSection, viewCommands),
Path.Combine(embeddedResourceFileWriter.TargetFolderPath,
"traject_6-3.shp"));
importer.Import();
Fisheye: Tag e949ab20d487bf97ab1cedf2b360fdb1f948419f refers to a dead (removed) revision in file `Ringtoets/Common/src/Ringtoets.Common.IO/ReferenceLines/IReferenceLineReplaceHandler.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/Common/src/Ringtoets.Common.IO/ReferenceLines/IReferenceLineUpdateHandler.cs
===================================================================
diff -u
--- Ringtoets/Common/src/Ringtoets.Common.IO/ReferenceLines/IReferenceLineUpdateHandler.cs (revision 0)
+++ Ringtoets/Common/src/Ringtoets.Common.IO/ReferenceLines/IReferenceLineUpdateHandler.cs (revision e949ab20d487bf97ab1cedf2b360fdb1f948419f)
@@ -0,0 +1,57 @@
+// Copyright (C) Stichting Deltares 2018. 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.Collections.Generic;
+using Core.Common.Base;
+using Ringtoets.Common.Data.AssessmentSection;
+
+namespace Ringtoets.Common.IO.ReferenceLines
+{
+ ///
+ /// Interface for an object that can properly replace a
+ /// from an .
+ ///
+ public interface IReferenceLineUpdateHandler
+ {
+ ///
+ /// Checks to see if the replacement of the should occur
+ /// or not.
+ ///
+ /// true if the replacement should occur, false otherwise.
+ bool ConfirmReplace();
+
+ ///
+ /// Replaces the of a
+ /// and propagates the changes to underlying data structure.
+ ///
+ /// The reference line to be updated.
+ /// The new reference line.
+ /// All objects that have been affected by the replacement.
+ /// Thrown when any parameter is null.
+ IEnumerable Replace(ReferenceLine originalReferenceLine, ReferenceLine newReferenceLine);
+
+ ///
+ /// Perform post-replacement updates.
+ ///
+ void DoPostReplacementUpdates();
+ }
+}
\ No newline at end of file
Index: Ringtoets/Common/src/Ringtoets.Common.IO/ReferenceLines/ReferenceLineImporter.cs
===================================================================
diff -u -r00b160ed6c781f5f20b3697143c255fc498b0ef1 -re949ab20d487bf97ab1cedf2b360fdb1f948419f
--- Ringtoets/Common/src/Ringtoets.Common.IO/ReferenceLines/ReferenceLineImporter.cs (.../ReferenceLineImporter.cs) (revision 00b160ed6c781f5f20b3697143c255fc498b0ef1)
+++ Ringtoets/Common/src/Ringtoets.Common.IO/ReferenceLines/ReferenceLineImporter.cs (.../ReferenceLineImporter.cs) (revision e949ab20d487bf97ab1cedf2b360fdb1f948419f)
@@ -36,7 +36,7 @@
public class ReferenceLineImporter : FileImporterBase
{
private readonly List changedObservables = new List();
- private readonly IReferenceLineReplaceHandler replacementHandler;
+ private readonly IReferenceLineUpdateHandler replacementHandler;
///
/// Initializes a new instance of the class.
@@ -48,7 +48,7 @@
/// Thrown when
/// or is null.
public ReferenceLineImporter(ReferenceLine importTarget,
- IReferenceLineReplaceHandler replacementHandler,
+ IReferenceLineUpdateHandler replacementHandler,
string filePath)
: base(filePath, importTarget)
{
Index: Ringtoets/Common/src/Ringtoets.Common.IO/Ringtoets.Common.IO.csproj
===================================================================
diff -u -raad074a1117fdd6eb1a371e2778e81263087cd0a -re949ab20d487bf97ab1cedf2b360fdb1f948419f
--- Ringtoets/Common/src/Ringtoets.Common.IO/Ringtoets.Common.IO.csproj (.../Ringtoets.Common.IO.csproj) (revision aad074a1117fdd6eb1a371e2778e81263087cd0a)
+++ Ringtoets/Common/src/Ringtoets.Common.IO/Ringtoets.Common.IO.csproj (.../Ringtoets.Common.IO.csproj) (revision e949ab20d487bf97ab1cedf2b360fdb1f948419f)
@@ -83,7 +83,7 @@
Resources.resx
-
+
Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/FileImporters/FailureMechanismSectionsImporterTest.cs
===================================================================
diff -u -r2aa1dd011d1580be5236b2477496f8e7adb1a12e -re949ab20d487bf97ab1cedf2b360fdb1f948419f
--- Ringtoets/Common/test/Ringtoets.Common.IO.Test/FileImporters/FailureMechanismSectionsImporterTest.cs (.../FailureMechanismSectionsImporterTest.cs) (revision 2aa1dd011d1580be5236b2477496f8e7adb1a12e)
+++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/FileImporters/FailureMechanismSectionsImporterTest.cs (.../FailureMechanismSectionsImporterTest.cs) (revision e949ab20d487bf97ab1cedf2b360fdb1f948419f)
@@ -741,7 +741,7 @@
var referenceLine = new ReferenceLine();
var mocks = new MockRepository();
- var handler = mocks.Stub();
+ var handler = mocks.Stub();
handler.Stub(h => h.ConfirmReplace()).Return(true);
handler.Stub(h => h.Replace(Arg.Is.NotNull,
Arg.Is.NotNull))
Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/ReferenceLines/ReferenceLineImporterTest.cs
===================================================================
diff -u -r4f0a2be792d13dd811a5f500f8dc3cbba5513d14 -re949ab20d487bf97ab1cedf2b360fdb1f948419f
--- Ringtoets/Common/test/Ringtoets.Common.IO.Test/ReferenceLines/ReferenceLineImporterTest.cs (.../ReferenceLineImporterTest.cs) (revision 4f0a2be792d13dd811a5f500f8dc3cbba5513d14)
+++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/ReferenceLines/ReferenceLineImporterTest.cs (.../ReferenceLineImporterTest.cs) (revision e949ab20d487bf97ab1cedf2b360fdb1f948419f)
@@ -42,7 +42,7 @@
public void Constructor_ReferenceLineNull_ThrowArgumentNullException()
{
var mocks = new MockRepository();
- var handler = mocks.Stub();
+ var handler = mocks.Stub();
mocks.ReplayAll();
// Call
@@ -59,7 +59,7 @@
{
// Setup
var mocks = new MockRepository();
- var handler = mocks.Stub();
+ var handler = mocks.Stub();
mocks.ReplayAll();
// Call
@@ -75,7 +75,7 @@
{
// Setup
var mocks = new MockRepository();
- var handler = mocks.StrictMock();
+ var handler = mocks.StrictMock();
handler.Expect(h => h.Replace(Arg.Is.NotNull,
Arg.Is.NotNull))
.WhenCalled(invocation =>
@@ -107,7 +107,7 @@
{
// Setup
var mocks = new MockRepository();
- var handler = mocks.Stub();
+ var handler = mocks.Stub();
handler.Expect(h => h.Replace(Arg.Is.NotNull,
Arg.Is.NotNull))
.Return(Enumerable.Empty());
@@ -154,7 +154,7 @@
{
// Setup
var mocks = new MockRepository();
- var handler = mocks.StrictMock();
+ var handler = mocks.StrictMock();
handler.Expect(h => h.ConfirmReplace())
.Repeat.Never();
handler.Expect(h => h.Replace(null, null))
@@ -183,7 +183,7 @@
{
// Setup
var mocks = new MockRepository();
- var handler = mocks.StrictMock();
+ var handler = mocks.StrictMock();
handler.Expect(h => h.ConfirmReplace())
.Repeat.Never();
handler.Expect(h => h.Replace(null, null))
@@ -212,7 +212,7 @@
{
// Setup
var mocks = new MockRepository();
- var handler = mocks.StrictMock();
+ var handler = mocks.StrictMock();
handler.Expect(h => h.ConfirmReplace()).Return(false);
handler.Expect(h => h.Replace(null, null))
.IgnoreArguments()
@@ -240,7 +240,7 @@
string path = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Common.IO, "traject_10-2.shp");
var mocks = new MockRepository();
- var handler = mocks.StrictMock();
+ var handler = mocks.StrictMock();
var importer = new ReferenceLineImporter(ReferenceLineTestFactory.CreateReferenceLineWithGeometry(), handler, path);
handler.Expect(h => h.ConfirmReplace())
.WhenCalled(invocation => importer.Cancel())
@@ -268,7 +268,7 @@
string path = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Common.IO, Path.Combine("ReferenceLine", "traject_10-2.shp"));
var mocks = new MockRepository();
- var handler = mocks.Stub();
+ var handler = mocks.Stub();
handler.Stub(h => h.ConfirmReplace())
.Return(true);
mocks.ReplayAll();
@@ -300,7 +300,7 @@
string path = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Common.IO, Path.Combine("ReferenceLine", "traject_10-2.shp"));
var mocks = new MockRepository();
- var handler = mocks.Stub();
+ var handler = mocks.Stub();
handler.Stub(h => h.ConfirmReplace())
.Return(true);
handler.Stub(h => h.Replace(Arg.Is.NotNull,
@@ -334,7 +334,7 @@
{
// Setup
var mocks = new MockRepository();
- var handler = mocks.StrictMock();
+ var handler = mocks.StrictMock();
handler.Expect(h => h.ConfirmReplace())
.Repeat.Never();
handler.Expect(h => h.Replace(Arg.Is.NotNull,
@@ -385,7 +385,7 @@
var observable2 = mocks.StrictMock();
observable2.Expect(o => o.NotifyObservers());
- var handler = mocks.StrictMock();
+ var handler = mocks.StrictMock();
handler.Expect(h => h.ConfirmReplace()).Return(true);
handler.Expect(h => h.Replace(Arg.Is.Same(referenceLine),
Arg.Is.NotNull))
@@ -421,7 +421,7 @@
var mocks = new MockRepository();
var observer = mocks.StrictMock();
- var handler = mocks.StrictMock();
+ var handler = mocks.StrictMock();
var importer = new ReferenceLineImporter(referenceLine, handler, path);
handler.Expect(h => h.ConfirmReplace())
.WhenCalled(invocation => importer.Cancel())
@@ -460,7 +460,7 @@
var observable2 = mocks.StrictMock();
observable2.Expect(o => o.NotifyObservers());
- var handler = mocks.Stub();
+ var handler = mocks.Stub();
handler.Stub(h => h.ConfirmReplace()).Return(true);
handler.Expect(h => h.Replace(Arg.Is.Same(referenceLine),
Arg.Is.NotNull))
Fisheye: Tag e949ab20d487bf97ab1cedf2b360fdb1f948419f refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Handlers/ReferenceLineReplacementHandler.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Handlers/ReferenceLineUpdateHandler.cs
===================================================================
diff -u
--- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Handlers/ReferenceLineUpdateHandler.cs (revision 0)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Handlers/ReferenceLineUpdateHandler.cs (revision e949ab20d487bf97ab1cedf2b360fdb1f948419f)
@@ -0,0 +1,108 @@
+// Copyright (C) Stichting Deltares 2018. 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.Collections.Generic;
+using System.Linq;
+using System.Windows.Forms;
+using Core.Common.Base;
+using Core.Common.Gui.Commands;
+using Ringtoets.Common.Data.AssessmentSection;
+using Ringtoets.Common.IO.ReferenceLines;
+using Ringtoets.Common.Service;
+using Ringtoets.Integration.Plugin.Properties;
+using Ringtoets.Integration.Service;
+using CoreCommonBaseResources = Core.Common.Base.Properties.Resources;
+
+namespace Ringtoets.Integration.Plugin.Handlers
+{
+ ///
+ /// Class responsible for replacing a on a .
+ ///
+ public class ReferenceLineUpdateHandler : IReferenceLineUpdateHandler
+ {
+ private readonly IAssessmentSection assessmentSection;
+ private readonly IViewCommands viewCommands;
+ private readonly Queue