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 @@ -1020,7 +1020,6 @@ RestoreDirectory = true, CheckFileExists = false }) - { if (dialog.ShowDialog(Gui.MainWindow) == DialogResult.OK) { try @@ -1032,7 +1031,6 @@ log.Error(exception.Message, exception); } } - } } /// @@ -1058,7 +1056,6 @@ } using (var hydraulicBoundaryLocationsImporter = new HydraulicBoundaryDatabaseImporter()) - { if (hydraulicBoundaryLocationsImporter.Import(assessmentSection, databaseFile)) { if (isClearConfirmationGiven) @@ -1069,7 +1066,6 @@ log.InfoFormat(RingtoetsFormsResources.RingtoetsPlugin_SetBoundaryDatabaseFilePath_Database_on_path_0_linked, assessmentSection.HydraulicBoundaryDatabase.FilePath); } - } } private static bool IsClearCalculationConfirmationGiven()