Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Plugin/ClosingStructuresPlugin.cs =================================================================== diff -u -r12cec002453a1828efc68633fbd25219632c6c47 -r8cc75c049ab3c1eee50a3309e09e18073b881c95 --- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Plugin/ClosingStructuresPlugin.cs (.../ClosingStructuresPlugin.cs) (revision 12cec002453a1828efc68633fbd25219632c6c47) +++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Plugin/ClosingStructuresPlugin.cs (.../ClosingStructuresPlugin.cs) (revision 8cc75c049ab3c1eee50a3309e09e18073b881c95) @@ -26,6 +26,7 @@ using System.Windows.Forms; using Core.Common.Base.IO; using Core.Common.Controls.TreeView; +using Core.Common.Gui; using Core.Common.Gui.ContextMenu; using Core.Common.Gui.Forms.ProgressDialog; using Core.Common.Gui.Plugin; @@ -204,7 +205,10 @@ Category = RingtoetsCommonFormsResources.Ringtoets_Category, Image = RingtoetsCommonFormsResources.StructuresIcon, FileFilterGenerator = CreateClosingStructureFileFilter(), - IsEnabled = context => context.AssessmentSection.ReferenceLine != null + IsEnabled = context => context.AssessmentSection.ReferenceLine != null, + VerifyUpdates = context => VerifyStructuresShouldUpdate( + context.FailureMechanism, + RingtoetsCommonIOResources.VerifyStructuresShouldUpdate_When_importing_Calculation_with_Structure_data_output_will_be_cleared_confirm) }; yield return RingtoetsImportInfoFactory.CreateCalculationConfigurationImportInfo( @@ -231,22 +235,13 @@ Image = RingtoetsCommonFormsResources.StructuresIcon, FileFilterGenerator = CreateClosingStructureFileFilter(), IsEnabled = c => c.FailureMechanism.ClosingStructures.SourcePath != null, - CurrentPath = context => context.WrappedData.SourcePath + CurrentPath = context => context.WrappedData.SourcePath, + VerifyUpdates = context => VerifyStructuresShouldUpdate( + context.FailureMechanism, + RingtoetsCommonIOResources.VerifyStructuresShouldUpdate_When_updating_Calculation_with_Structure_data_output_will_be_cleared_confirm) }; } - private IFileImporter CreateHeightStructuresImporter(ClosingStructuresContext context, - string filePath, - IImporterMessageProvider importerMessageProvider, - IStructureUpdateStrategy structureUpdateStrategy) - { - return new ClosingStructuresImporter(context.WrappedData, - context.AssessmentSection.ReferenceLine, - filePath, - importerMessageProvider, - structureUpdateStrategy); - } - public override IEnumerable GetExportInfos() { yield return RingtoetsExportInfoFactory.CreateCalculationGroupConfigurationExportInfo( @@ -260,13 +255,6 @@ }, filePath)); } - private static FileFilterGenerator CreateClosingStructureFileFilter() - { - return new FileFilterGenerator( - RingtoetsCommonIOResources.Shape_file_filter_Extension, - RingtoetsCommonIOResources.Shape_file_filter_Description); - } - private static string ValidateAllDataAvailableAndGetErrorMessage(IAssessmentSection assessmentSection, IFailureMechanism failureMechanism) { if (failureMechanism.Contribution <= 0.0) @@ -746,5 +734,41 @@ #endregion #endregion + + #region Importers + + #region ClosingStructuresImporter + + private IFileImporter CreateHeightStructuresImporter(ClosingStructuresContext context, + string filePath, + IImporterMessageProvider importerMessageProvider, + IStructureUpdateStrategy structureUpdateStrategy) + { + return new ClosingStructuresImporter(context.WrappedData, + context.AssessmentSection.ReferenceLine, + filePath, + importerMessageProvider, + structureUpdateStrategy); + } + + private static FileFilterGenerator CreateClosingStructureFileFilter() + { + return new FileFilterGenerator( + RingtoetsCommonIOResources.Shape_file_filter_Extension, + RingtoetsCommonIOResources.Shape_file_filter_Description); + } + + private bool VerifyStructuresShouldUpdate(IFailureMechanism failureMechanism, string query) + { + var changeHandler = new FailureMechanismCalculationChangeHandler(failureMechanism, + query, + new DialogBasedInquiryHelper(Gui.MainWindow)); + + return !changeHandler.RequireConfirmation() || changeHandler.InquireConfirmation(); + } + + #endregion + + #endregion } } \ No newline at end of file Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/FileImporters/ClosingStructureUpdateDataStrategyTest.cs =================================================================== diff -u -rb7f91e5d6aaac3c9a52cfda9b1bdd3a74ee4f8b1 -r8cc75c049ab3c1eee50a3309e09e18073b881c95 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/FileImporters/ClosingStructureUpdateDataStrategyTest.cs (.../ClosingStructureUpdateDataStrategyTest.cs) (revision b7f91e5d6aaac3c9a52cfda9b1bdd3a74ee4f8b1) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/FileImporters/ClosingStructureUpdateDataStrategyTest.cs (.../ClosingStructureUpdateDataStrategyTest.cs) (revision 8cc75c049ab3c1eee50a3309e09e18073b881c95) @@ -618,12 +618,12 @@ ClosingStructuresFailureMechanismSectionResult[] sectionResults = failureMechanism.SectionResults.ToArray(); + var strategy = new ClosingStructureUpdateDataStrategy(failureMechanism); + // Precondition Assert.AreSame(calculation, sectionResults[0].Calculation); Assert.IsNull(sectionResults[1].Calculation); - var strategy = new ClosingStructureUpdateDataStrategy(failureMechanism); - // Call IEnumerable affectedObjects = strategy.UpdateStructuresWithImportedData( failureMechanism.ClosingStructures, Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/ImportInfos/ClosingStructuresContextImportInfoTest.cs =================================================================== diff -u -rc4e2a1db42a818567d116298b5c163b56b69ce0e -r8cc75c049ab3c1eee50a3309e09e18073b881c95 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/ImportInfos/ClosingStructuresContextImportInfoTest.cs (.../ClosingStructuresContextImportInfoTest.cs) (revision c4e2a1db42a818567d116298b5c163b56b69ce0e) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/ImportInfos/ClosingStructuresContextImportInfoTest.cs (.../ClosingStructuresContextImportInfoTest.cs) (revision 8cc75c049ab3c1eee50a3309e09e18073b881c95) @@ -19,52 +19,33 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using System.Drawing; using System.Linq; using Core.Common.Base.IO; +using Core.Common.Gui; +using Core.Common.Gui.Forms.MainWindow; using Core.Common.Gui.Plugin; using Core.Common.TestUtil; using Core.Common.Utils; +using NUnit.Extensions.Forms; using NUnit.Framework; using Rhino.Mocks; using Ringtoets.ClosingStructures.Data; using Ringtoets.ClosingStructures.Forms.PresentationObjects; using Ringtoets.ClosingStructures.IO; +using Ringtoets.Common.Data; using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.Structures; +using Ringtoets.Common.Data.TestUtil; using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; namespace Ringtoets.ClosingStructures.Plugin.Test.ImportInfos { [TestFixture] - public class ClosingStructuresContextImportInfoTest + public class ClosingStructuresContextImportInfoTest : NUnitFormTest { [Test] - public void CreateFileImporter_Always_ReturnFileImporter() - { - // Setup - var mocks = new MockRepository(); - var assessmentSectionStub = mocks.Stub(); - mocks.ReplayAll(); - - assessmentSectionStub.ReferenceLine = new ReferenceLine(); - - var failureMechanism = new ClosingStructuresFailureMechanism(); - var importTarget = new ClosingStructuresContext(failureMechanism.ClosingStructures, failureMechanism, assessmentSectionStub); - - using (var plugin = new ClosingStructuresPlugin()) - { - ImportInfo importInfo = GetImportInfo(plugin); - - // Call - IFileImporter importer = importInfo.CreateFileImporter(importTarget, "test"); - - // Assert - Assert.IsInstanceOf(importer); - } - mocks.VerifyAll(); - } - - [Test] public void Name_Always_ReturnExpectedName() { // Setup @@ -177,6 +158,120 @@ mocks.VerifyAll(); } + [Test] + public void CreateFileImporter_Always_ReturnFileImporter() + { + // Setup + var mocks = new MockRepository(); + var assessmentSectionStub = mocks.Stub(); + mocks.ReplayAll(); + + assessmentSectionStub.ReferenceLine = new ReferenceLine(); + + var failureMechanism = new ClosingStructuresFailureMechanism(); + var importTarget = new ClosingStructuresContext(failureMechanism.ClosingStructures, failureMechanism, assessmentSectionStub); + + using (var plugin = new ClosingStructuresPlugin()) + { + ImportInfo importInfo = GetImportInfo(plugin); + + // Call + IFileImporter importer = importInfo.CreateFileImporter(importTarget, "test"); + + // Assert + Assert.IsInstanceOf(importer); + } + mocks.VerifyAll(); + } + + [Test] + public void VerifyUpdates_CalculationWithoutOutputs_ReturnsTrue() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + var mainWindow = mocks.Stub(); + var gui = mocks.Stub(); + gui.Stub(g => g.MainWindow).Return(mainWindow); + mocks.ReplayAll(); + + using (var plugin = new ClosingStructuresPlugin()) + { + plugin.Gui = gui; + + var failureMechanism = new ClosingStructuresFailureMechanism(); + failureMechanism.CalculationsGroup.Children.Add(new StructuresCalculation()); + + var structures = new StructureCollection(); + var context = new ClosingStructuresContext(structures, failureMechanism, assessmentSection); + + ImportInfo importInfo = GetImportInfo(plugin); + + // Call + bool updatesVerified = importInfo.VerifyUpdates(context); + + // Assert + Assert.IsTrue(updatesVerified); + mocks.VerifyAll(); + } + } + + [Test] + [TestCase(true)] + [TestCase(false)] + public void VerifyUpdates_CalculationWithOutputs_AlwaysReturnsExpectedInquiryMessage(bool isActionConfirmed) + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + var mainWindow = mocks.Stub(); + var gui = mocks.Stub(); + gui.Stub(g => g.MainWindow).Return(mainWindow); + mocks.ReplayAll(); + + using (var plugin = new ClosingStructuresPlugin()) + { + plugin.Gui = gui; + + var failureMechanism = new ClosingStructuresFailureMechanism(); + failureMechanism.CalculationsGroup.Children.Add(new StructuresCalculation + { + Output = new TestStructuresOutput() + }); + + var structures = new StructureCollection(); + var context = new ClosingStructuresContext(structures, failureMechanism, assessmentSection); + + ImportInfo importInfo = GetImportInfo(plugin); + + string textBoxMessage = null; + DialogBoxHandler = (name, wnd) => + { + var helper = new MessageBoxTester(wnd); + textBoxMessage = helper.Text; + + if (isActionConfirmed) + { + helper.ClickOk(); + } + else + { + helper.ClickCancel(); + } + }; + + // Call + bool updatesVerified = importInfo.VerifyUpdates(context); + + // Assert + string expectedInquiryMessage = "Als u kunstwerken importeert, dan worden alle rekenresultaten van dit toetsspoor verwijderd." + + $"{Environment.NewLine}{Environment.NewLine}Weet u zeker dat u wilt doorgaan?"; + Assert.AreEqual(expectedInquiryMessage, textBoxMessage); + Assert.AreEqual(isActionConfirmed, updatesVerified); + mocks.VerifyAll(); + } + } + private static ImportInfo GetImportInfo(ClosingStructuresPlugin plugin) { return plugin.GetImportInfos().First(ii => ii.DataType == typeof(ClosingStructuresContext)); Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/Ringtoets.ClosingStructures.Plugin.Test.csproj =================================================================== diff -u -r12cec002453a1828efc68633fbd25219632c6c47 -r8cc75c049ab3c1eee50a3309e09e18073b881c95 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/Ringtoets.ClosingStructures.Plugin.Test.csproj (.../Ringtoets.ClosingStructures.Plugin.Test.csproj) (revision 12cec002453a1828efc68633fbd25219632c6c47) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/Ringtoets.ClosingStructures.Plugin.Test.csproj (.../Ringtoets.ClosingStructures.Plugin.Test.csproj) (revision 8cc75c049ab3c1eee50a3309e09e18073b881c95) @@ -78,6 +78,7 @@ + Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/UpdateInfos/ClosingStructuresContextUpdateInfoTest.cs =================================================================== diff -u --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/UpdateInfos/ClosingStructuresContextUpdateInfoTest.cs (revision 0) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/UpdateInfos/ClosingStructuresContextUpdateInfoTest.cs (revision 8cc75c049ab3c1eee50a3309e09e18073b881c95) @@ -0,0 +1,272 @@ +// Copyright (C) Stichting Deltares 2017. 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.Linq; +using Core.Common.Base.IO; +using Core.Common.Gui; +using Core.Common.Gui.Forms.MainWindow; +using Core.Common.Gui.Plugin; +using Core.Common.TestUtil; +using NUnit.Extensions.Forms; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.Common.Data; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.Structures; +using Ringtoets.Common.Data.TestUtil; +using Ringtoets.ClosingStructures.Data; +using Ringtoets.ClosingStructures.Forms.PresentationObjects; +using Ringtoets.ClosingStructures.IO; +using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; + +namespace Ringtoets.ClosingStructures.Plugin.Test.UpdateInfos +{ + [TestFixture] + public class ClosingStructuresContextUpdateInfoTest : NUnitFormTest + { + private UpdateInfo updateInfo; + private ClosingStructuresPlugin plugin; + + [SetUp] + public void SetUp() + { + plugin = new ClosingStructuresPlugin(); + updateInfo = plugin.GetUpdateInfos().First(i => i.DataType == typeof(ClosingStructuresContext)); + } + + [TearDown] + public override void TearDown() + { + plugin.Dispose(); + } + + [Test] + public void Name_Always_ReturnExpectedName() + { + // Call + string name = updateInfo.Name; + + // Assert + Assert.AreEqual("Kunstwerken", name); + } + + [Test] + public void Category_Always_ReturnExpectedCategory() + { + // Call + string category = updateInfo.Category; + + // Assert + Assert.AreEqual("Algemeen", category); + } + + [Test] + public void Image_Always_ReturnExpectedIcon() + { + // Call + Image image = updateInfo.Image; + + // Assert + TestHelper.AssertImagesAreEqual(RingtoetsCommonFormsResources.StructuresIcon, image); + } + + [Test] + public void IsEnabled_SourcePathNull_ReturnFalse() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + var failureMechanism = new ClosingStructuresFailureMechanism(); + var structures = new StructureCollection(); + + var context = new ClosingStructuresContext(structures, failureMechanism, assessmentSection); + + // Call + bool isEnabled = updateInfo.IsEnabled(context); + + // Assert + Assert.IsFalse(isEnabled); + mocks.VerifyAll(); + } + + [Test] + public void IsEnabled_SourcePathSet_ReturnTrue() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + var failureMechanism = new ClosingStructuresFailureMechanism(); + failureMechanism.ClosingStructures.AddRange(Enumerable.Empty(), "some path"); + + var context = new ClosingStructuresContext(failureMechanism.ClosingStructures, + failureMechanism, + assessmentSection); + + // Call + bool isEnabled = updateInfo.IsEnabled(context); + + // Assert + Assert.IsTrue(isEnabled); + mocks.VerifyAll(); + } + + [Test] + public void FileFilterGenerator_Always_ReturnExpectedFileFilter() + { + // Call + string fileFilter = updateInfo.FileFilterGenerator.Filter; + + // Assert + Assert.AreEqual(@"Shapebestand (*.shp)|*.shp", fileFilter); + } + + [Test] + public void CurrentPath_StructureCollectionHasPathSet_ReturnsExpectedPath() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + const string expectedFilePath = "some/path"; + var structures = new StructureCollection(); + structures.AddRange(Enumerable.Empty(), expectedFilePath); + + var failureMechanism = new ClosingStructuresFailureMechanism(); + var context = new ClosingStructuresContext(structures, failureMechanism, assessmentSection); + + // Call + string currentPath = updateInfo.CurrentPath(context); + + // Assert + Assert.AreEqual(expectedFilePath, currentPath); + mocks.VerifyAll(); + } + + [Test] + public void CreateFileImporter_ValidInput_ReturnFileImporter() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + assessmentSection.ReferenceLine = new ReferenceLine(); + + var failureMechanism = new ClosingStructuresFailureMechanism(); + var structures = new StructureCollection(); + + var importTarget = new ClosingStructuresContext(structures, failureMechanism, assessmentSection); + + // Call + IFileImporter importer = updateInfo.CreateFileImporter(importTarget, "This is valid"); + + // Assert + Assert.IsInstanceOf(importer); + mocks.VerifyAll(); + } + + [Test] + public void VerifyUpdates_CalculationWithoutOutputs_ReturnsTrue() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + var mainWindow = mocks.Stub(); + var gui = mocks.Stub(); + gui.Stub(g => g.MainWindow).Return(mainWindow); + mocks.ReplayAll(); + + plugin.Gui = gui; + + var failureMechanism = new ClosingStructuresFailureMechanism(); + failureMechanism.CalculationsGroup.Children.Add(new StructuresCalculation()); + + var structures = new StructureCollection(); + var context = new ClosingStructuresContext(structures, failureMechanism, assessmentSection); + + // Call + bool updatesVerified = updateInfo.VerifyUpdates(context); + + // Assert + Assert.IsTrue(updatesVerified); + mocks.VerifyAll(); + } + + [Test] + [TestCase(true)] + [TestCase(false)] + public void VerifyUpdates_CalculationWithOutputs_AlwaysReturnsExpectedInquiryMessage(bool isActionConfirmed) + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + var mainWindow = mocks.Stub(); + var gui = mocks.Stub(); + gui.Stub(g => g.MainWindow).Return(mainWindow); + mocks.ReplayAll(); + + plugin.Gui = gui; + + var failureMechanism = new ClosingStructuresFailureMechanism(); + failureMechanism.CalculationsGroup.Children.Add(new StructuresCalculation + { + Output = new TestStructuresOutput() + }); + + var structures = new StructureCollection(); + var context = new ClosingStructuresContext(structures, failureMechanism, assessmentSection); + + string textBoxMessage = null; + DialogBoxHandler = (name, wnd) => + { + var helper = new MessageBoxTester(wnd); + textBoxMessage = helper.Text; + + if (isActionConfirmed) + { + helper.ClickOk(); + } + else + { + helper.ClickCancel(); + } + }; + + // Call + bool updatesVerified = updateInfo.VerifyUpdates(context); + + // Assert + string expectedInquiryMessage = "Wanneer de kunstwerken wijzigen als gevolg van het bijwerken " + + "zullen de resultaten van berekeningen die deze kunstwerken gebruiken worden verwijderd." + + $"{Environment.NewLine}{Environment.NewLine}Weet u zeker dat u wilt doorgaan?"; + Assert.AreEqual(expectedInquiryMessage, textBoxMessage); + Assert.AreEqual(isActionConfirmed, updatesVerified); + mocks.VerifyAll(); + } + } +} \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.IO/Properties/Resources.Designer.cs =================================================================== diff -u -rd04ad1959f4c004962f95442ad2e076115f004ab -r8cc75c049ab3c1eee50a3309e09e18073b881c95 --- Ringtoets/Common/src/Ringtoets.Common.IO/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision d04ad1959f4c004962f95442ad2e076115f004ab) +++ Ringtoets/Common/src/Ringtoets.Common.IO/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 8cc75c049ab3c1eee50a3309e09e18073b881c95) @@ -1870,6 +1870,30 @@ } /// + /// Looks up a localized string similar to Als u kunstwerken importeert, dan worden alle rekenresultaten van dit toetsspoor verwijderd. + /// + ///Weet u zeker dat u wilt doorgaan?. + /// + public static string VerifyStructuresShouldUpdate_When_importing_Calculation_with_Structure_data_output_will_be_cleared_confirm { + get { + return ResourceManager.GetString("VerifyStructuresShouldUpdate_When_importing_Calculation_with_Structure_data_outpu" + + "t_will_be_cleared_confirm", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Wanneer de kunstwerken wijzigen als gevolg van het bijwerken zullen de resultaten van berekeningen die deze kunstwerken gebruiken worden verwijderd. + /// + ///Weet u zeker dat u wilt doorgaan?. + /// + public static string VerifyStructuresShouldUpdate_When_updating_Calculation_with_Structure_data_output_will_be_cleared_confirm { + get { + return ResourceManager.GetString("VerifyStructuresShouldUpdate_When_updating_Calculation_with_Structure_data_output" + + "_will_be_cleared_confirm", resourceCulture); + } + } + + /// /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8"?><!-- ///Copyright (C) Stichting Deltares 2017. All rights reserved. /// Index: Ringtoets/Common/src/Ringtoets.Common.IO/Properties/Resources.resx =================================================================== diff -u -rd04ad1959f4c004962f95442ad2e076115f004ab -r8cc75c049ab3c1eee50a3309e09e18073b881c95 --- Ringtoets/Common/src/Ringtoets.Common.IO/Properties/Resources.resx (.../Resources.resx) (revision d04ad1959f4c004962f95442ad2e076115f004ab) +++ Ringtoets/Common/src/Ringtoets.Common.IO/Properties/Resources.resx (.../Resources.resx) (revision 8cc75c049ab3c1eee50a3309e09e18073b881c95) @@ -649,4 +649,14 @@ Het importeren van de {0} is mislukt: {{0}} + + Als u kunstwerken importeert, dan worden alle rekenresultaten van dit toetsspoor verwijderd. + +Weet u zeker dat u wilt doorgaan? + + + Wanneer de kunstwerken wijzigen als gevolg van het bijwerken zullen de resultaten van berekeningen die deze kunstwerken gebruiken worden verwijderd. + +Weet u zeker dat u wilt doorgaan? + \ No newline at end of file Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Plugin/HeightStructuresPlugin.cs =================================================================== diff -u -reef2f17598bbe7b051207dfac25952567d57f64c -r8cc75c049ab3c1eee50a3309e09e18073b881c95 --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Plugin/HeightStructuresPlugin.cs (.../HeightStructuresPlugin.cs) (revision eef2f17598bbe7b051207dfac25952567d57f64c) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Plugin/HeightStructuresPlugin.cs (.../HeightStructuresPlugin.cs) (revision 8cc75c049ab3c1eee50a3309e09e18073b881c95) @@ -59,7 +59,6 @@ using Ringtoets.HeightStructures.IO; using Ringtoets.HeightStructures.IO.Configurations; using Ringtoets.HeightStructures.Plugin.FileImporters; -using Ringtoets.HeightStructures.Plugin.Properties; using Ringtoets.HeightStructures.Service; using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; using RingtoetsCommonDataResources = Ringtoets.Common.Data.Properties.Resources; @@ -105,9 +104,7 @@ CreateFileImporter = (context, filePath) => CreateHeightStructuresImporter( context, filePath, new ImportMessageProvider(), new HeightStructureReplaceDataStrategy(context.FailureMechanism)), VerifyUpdates = context => - VerifyHeightStructuresShouldUpdate( - context, - Resources.HeightStructuresPlugin_VerifyHeightStructuresShouldUpdate_When_importing_Calculation_with_Structure_data_output_will_be_cleared_confirm) + VerifyStructuresShouldUpdate(context.FailureMechanism, RingtoetsCommonIOResources.VerifyStructuresShouldUpdate_When_importing_Calculation_with_Structure_data_output_will_be_cleared_confirm) }; yield return RingtoetsImportInfoFactory.CreateCalculationConfigurationImportInfo( @@ -133,9 +130,7 @@ context, filePath, new UpdateMessageProvider(), new HeightStructureUpdateDataStrategy(context.FailureMechanism)), CurrentPath = context => context.WrappedData.SourcePath, VerifyUpdates = context => - VerifyHeightStructuresShouldUpdate( - context, - Resources.HeightStructuresPlugin_VerifyHeightStructuresShouldUpdate_When_updating_Calculation_with_Structure_data_output_will_be_cleared_confirm) + VerifyStructuresShouldUpdate(context.FailureMechanism, RingtoetsCommonIOResources.VerifyStructuresShouldUpdate_When_updating_Calculation_with_Structure_data_output_will_be_cleared_confirm) }; } @@ -913,9 +908,9 @@ RingtoetsCommonIOResources.Shape_file_filter_Description); } - private bool VerifyHeightStructuresShouldUpdate(HeightStructuresContext context, string query) + private bool VerifyStructuresShouldUpdate(IFailureMechanism failureMechanism, string query) { - var changeHandler = new FailureMechanismCalculationChangeHandler(context.FailureMechanism, + var changeHandler = new FailureMechanismCalculationChangeHandler(failureMechanism, query, new DialogBasedInquiryHelper(Gui.MainWindow)); Fisheye: Tag 8cc75c049ab3c1eee50a3309e09e18073b881c95 refers to a dead (removed) revision in file `Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Plugin/Properties/Resources.Designer.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8cc75c049ab3c1eee50a3309e09e18073b881c95 refers to a dead (removed) revision in file `Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Plugin/Properties/Resources.resx'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Plugin/Ringtoets.HeightStructures.Plugin.csproj =================================================================== diff -u -rbc752890b4f52991a673a59c089db400be0e6fc3 -r8cc75c049ab3c1eee50a3309e09e18073b881c95 --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Plugin/Ringtoets.HeightStructures.Plugin.csproj (.../Ringtoets.HeightStructures.Plugin.csproj) (revision bc752890b4f52991a673a59c089db400be0e6fc3) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Plugin/Ringtoets.HeightStructures.Plugin.csproj (.../Ringtoets.HeightStructures.Plugin.csproj) (revision 8cc75c049ab3c1eee50a3309e09e18073b881c95) @@ -45,11 +45,6 @@ - - True - True - Resources.resx - @@ -138,12 +133,6 @@ Copying.licenseheader - - - ResXFileCodeGenerator - Resources.Designer.cs - -