Index: Core/Common/src/Core.Common.Controls.TreeView/TreeNodeInfo.cs =================================================================== diff -u -rd03f2b52982110a0f804adfefe73f86551c59e62 -rfd98bcf5d1811dbcad2cc0e292a4349f8402b83a --- Core/Common/src/Core.Common.Controls.TreeView/TreeNodeInfo.cs (.../TreeNodeInfo.cs) (revision d03f2b52982110a0f804adfefe73f86551c59e62) +++ Core/Common/src/Core.Common.Controls.TreeView/TreeNodeInfo.cs (.../TreeNodeInfo.cs) (revision fd98bcf5d1811dbcad2cc0e292a4349f8402b83a) @@ -64,8 +64,9 @@ /// /// Gets or sets a function for determining whether or not the tree node should become visible and selected on creation. /// The object parameter represents the data of the tree node. + /// The second object parameter represents the data of the parent tree node. /// - public Func EnsureVisibleOnCreate { get; set; } + public Func EnsureVisibleOnCreate { get; set; } /// /// Gets or sets a function for obtaining child node objects. @@ -201,8 +202,9 @@ /// /// Gets or sets a function for determining whether or not the tree node should become visible and selected on creation. /// The parameter represents the data of the tree node. + /// The object parameter represents the data of the parent tree node. /// - public Func EnsureVisibleOnCreate { get; set; } + public Func EnsureVisibleOnCreate { get; set; } /// /// Gets or sets a function for obtaining child node objects. @@ -314,8 +316,8 @@ ? (tag, parentTag, treeViewControl) => treeNodeInfo.ContextMenuStrip((TData) tag, parentTag, treeViewControl) : (Func) null, EnsureVisibleOnCreate = treeNodeInfo.EnsureVisibleOnCreate != null - ? tag => treeNodeInfo.EnsureVisibleOnCreate((TData) tag) - : (Func) null, + ? (tag, parentTag) => treeNodeInfo.EnsureVisibleOnCreate((TData) tag, parentTag) + : (Func) null, ChildNodeObjects = treeNodeInfo.ChildNodeObjects != null ? tag => treeNodeInfo.ChildNodeObjects((TData) tag) : (Func) null, Index: Core/Common/src/Core.Common.Controls.TreeView/TreeViewControl.cs =================================================================== diff -u -r3976f9a99ffe93215ffaa9af9a626a4d4985c736 -rfd98bcf5d1811dbcad2cc0e292a4349f8402b83a --- Core/Common/src/Core.Common.Controls.TreeView/TreeViewControl.cs (.../TreeViewControl.cs) (revision 3976f9a99ffe93215ffaa9af9a626a4d4985c736) +++ Core/Common/src/Core.Common.Controls.TreeView/TreeViewControl.cs (.../TreeViewControl.cs) (revision fd98bcf5d1811dbcad2cc0e292a4349f8402b83a) @@ -547,7 +547,7 @@ var dataObject = node.Tag; var info = TryGetTreeNodeInfoForData(dataObject); - return info.EnsureVisibleOnCreate != null && info.EnsureVisibleOnCreate(dataObject); + return info.EnsureVisibleOnCreate != null && info.EnsureVisibleOnCreate(dataObject, node.Parent.Tag); }); if (lastAddedNodeToSetSelectionTo != null) Index: Core/Common/test/Core.Common.Controls.TreeView.Test/TreeNodeInfoTest.cs =================================================================== diff -u -rf53409d55a702234dee65ac510f1dce4ef2e1e3d -rfd98bcf5d1811dbcad2cc0e292a4349f8402b83a --- Core/Common/test/Core.Common.Controls.TreeView.Test/TreeNodeInfoTest.cs (.../TreeNodeInfoTest.cs) (revision f53409d55a702234dee65ac510f1dce4ef2e1e3d) +++ Core/Common/test/Core.Common.Controls.TreeView.Test/TreeNodeInfoTest.cs (.../TreeNodeInfoTest.cs) (revision fd98bcf5d1811dbcad2cc0e292a4349f8402b83a) @@ -46,7 +46,7 @@ Func foreColor = o => Color.Azure; Func image = o => new Bitmap(16, 16); Func contextMenuStrip = (o1, o2, tvc) => new ContextMenuStrip(); - Func ensureVisibleOnCreate = o => true; + Func ensureVisibleOnCreate = (o, p) => true; Func childNodeObjects = o => new object[0]; Func canRename = (o1, o2) => true; Action onNodeRenamed = (o, newName) => { }; @@ -137,7 +137,7 @@ Func foreColor = o => Color.Azure; Func image = o => new Bitmap(16, 16); Func contextMenuStrip = (o1, o2, tvc) => new ContextMenuStrip(); - Func ensureVisibleOnCreate = o => true; + Func ensureVisibleOnCreate = (o, p) => true; Func childNodeObjects = o => new object[0]; Func canRename = (o1, o2) => true; Action onNodeRenamed = (o, newName) => { }; @@ -249,7 +249,7 @@ new ToolStripButton() } }, - EnsureVisibleOnCreate = o => true, + EnsureVisibleOnCreate = (o, p) => true, ChildNodeObjects = o => new[] { new object() @@ -279,7 +279,7 @@ Assert.AreEqual(Color.Azure, treeNodeInfo.ForeColor(0)); Assert.AreEqual(16, treeNodeInfo.Image(0).Height); Assert.AreEqual(1, treeNodeInfo.ContextMenuStrip(0, 1, treeViewControl).Items.Count); - Assert.IsTrue(treeNodeInfo.EnsureVisibleOnCreate(0)); + Assert.IsTrue(treeNodeInfo.EnsureVisibleOnCreate(0, 1)); Assert.AreEqual(1, treeNodeInfo.ChildNodeObjects(0).Length); Assert.IsTrue(treeNodeInfo.CanRename(0, 1)); Assert.IsTrue(treeNodeInfo.CanRemove(0, 1)); Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -r77c09b9a2aecfd8931db21ab3d16719b0b6e91db -rfd98bcf5d1811dbcad2cc0e292a4349f8402b83a --- Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 77c09b9a2aecfd8931db21ab3d16719b0b6e91db) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision fd98bcf5d1811dbcad2cc0e292a4349f8402b83a) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// Runtime Version:4.0.30319.34209 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -340,7 +340,7 @@ } /// - /// Looks up a localized string similar to Is relevant. + /// Looks up a localized string similar to I&s relevant. /// public static string FailureMechanismContextMenuStrip_Is_relevant { get { Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx =================================================================== diff -u -r77c09b9a2aecfd8931db21ab3d16719b0b6e91db -rfd98bcf5d1811dbcad2cc0e292a4349f8402b83a --- Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx (.../Resources.resx) (revision 77c09b9a2aecfd8931db21ab3d16719b0b6e91db) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx (.../Resources.resx) (revision fd98bcf5d1811dbcad2cc0e292a4349f8402b83a) @@ -287,7 +287,7 @@ ..\Resources\Checkbox_ticked.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - Is relevant + I&s relevant Geeft aan of dit faalmechanisme relevant is of niet. Index: Ringtoets/Common/src/Ringtoets.Common.Forms/TreeNodeInfos/CalculationTreeNodeInfoFactory.cs =================================================================== diff -u -r77c09b9a2aecfd8931db21ab3d16719b0b6e91db -rfd98bcf5d1811dbcad2cc0e292a4349f8402b83a --- Ringtoets/Common/src/Ringtoets.Common.Forms/TreeNodeInfos/CalculationTreeNodeInfoFactory.cs (.../CalculationTreeNodeInfoFactory.cs) (revision 77c09b9a2aecfd8931db21ab3d16719b0b6e91db) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/TreeNodeInfos/CalculationTreeNodeInfoFactory.cs (.../CalculationTreeNodeInfoFactory.cs) (revision fd98bcf5d1811dbcad2cc0e292a4349f8402b83a) @@ -57,7 +57,7 @@ { Text = context => context.WrappedData.Name, Image = context => Resources.GeneralFolderIcon, - EnsureVisibleOnCreate = context => true, + EnsureVisibleOnCreate = (context, parent) => !(parent is IFailureMechanismContext), ChildNodeObjects = childNodeObjects, ContextMenuStrip = contextMenuStrip, CanRename = (context, parentData) => IsNestedGroup(parentData), Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/TreeNodeInfos/CalculationTreeNodeInfoFactoryTest.cs =================================================================== diff -u -r77c09b9a2aecfd8931db21ab3d16719b0b6e91db -rfd98bcf5d1811dbcad2cc0e292a4349f8402b83a --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/TreeNodeInfos/CalculationTreeNodeInfoFactoryTest.cs (.../CalculationTreeNodeInfoFactoryTest.cs) (revision 77c09b9a2aecfd8931db21ab3d16719b0b6e91db) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/TreeNodeInfos/CalculationTreeNodeInfoFactoryTest.cs (.../CalculationTreeNodeInfoFactoryTest.cs) (revision fd98bcf5d1811dbcad2cc0e292a4349f8402b83a) @@ -490,13 +490,30 @@ } [Test] - public void EnsureVisibleOnCreateOfCalculationGroupContextTreeNodeInfo_Always_ReturnsTrue() + public void EnsureVisibleOnCreateOfCalculationGroupContextTreeNodeInfo_ForFailureMechanismCalculationGroup_ReturnsFalse() { // Setup + var mocks = new MockRepository(); + var failureMechanismMock = mocks.StrictMock>(); + mocks.ReplayAll(); + var treeNodeInfo = CalculationTreeNodeInfoFactory.CreateCalculationGroupContextTreeNodeInfo(null, null, null); + // Call + var result = treeNodeInfo.EnsureVisibleOnCreate(null, failureMechanismMock); + // Assert + Assert.IsFalse(result); + mocks.VerifyAll(); + } + + [Test] + public void EnsureVisibleOnCreateOfCalculationGroupContextTreeNodeInfo_AnyOtherObject_ReturnsTrue() + { + // Setup + var treeNodeInfo = CalculationTreeNodeInfoFactory.CreateCalculationGroupContextTreeNodeInfo(null, null, null); + // Call - var result = treeNodeInfo.EnsureVisibleOnCreate(null); + var result = treeNodeInfo.EnsureVisibleOnCreate(null, null); // Assert Assert.IsTrue(result); Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsGuiPlugin.cs =================================================================== diff -u -r77c09b9a2aecfd8931db21ab3d16719b0b6e91db -rfd98bcf5d1811dbcad2cc0e292a4349f8402b83a --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsGuiPlugin.cs (.../GrassCoverErosionInwardsGuiPlugin.cs) (revision 77c09b9a2aecfd8931db21ab3d16719b0b6e91db) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsGuiPlugin.cs (.../GrassCoverErosionInwardsGuiPlugin.cs) (revision fd98bcf5d1811dbcad2cc0e292a4349f8402b83a) @@ -79,7 +79,7 @@ { Text = context => context.WrappedData.Name, Image = context => GrassCoverErosionInwardsFormsResources.CalculationIcon, - EnsureVisibleOnCreate = context => true, + EnsureVisibleOnCreate = (context, parent) => true, ChildNodeObjects = CalculationContextChildNodeObjects }; Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs =================================================================== diff -u -r392c4a63ebfaee062d8dc611ecf41881ac1fe3a5 -rfd98bcf5d1811dbcad2cc0e292a4349f8402b83a --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs) (revision 392c4a63ebfaee062d8dc611ecf41881ac1fe3a5) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs) (revision fd98bcf5d1811dbcad2cc0e292a4349f8402b83a) @@ -101,24 +101,11 @@ [Test] public void EnsureVisibleOnCreate_Always_ReturnsTrue() { - // Setup - var calculation = new GrassCoverErosionInwardsCalculation(new GeneralGrassCoverErosionInwardsInput()); - - var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); - var assessmentSectionMock = mocksRepository.StrictMock(); - mocksRepository.ReplayAll(); - - var calculationContext = new GrassCoverErosionInwardsCalculationContext(calculation, failureMechanism, assessmentSectionMock); - - mocksRepository.ReplayAll(); - // Call - var result = info.EnsureVisibleOnCreate(calculationContext); + var result = info.EnsureVisibleOnCreate(null, null); // Assert Assert.IsTrue(result); - - mocksRepository.VerifyAll(); } [Test] Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsGuiPlugin.cs =================================================================== diff -u -r743c32ba40bc0d0165d0513d6ca95282b1021e6a -rfd98bcf5d1811dbcad2cc0e292a4349f8402b83a --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsGuiPlugin.cs (.../RingtoetsGuiPlugin.cs) (revision 743c32ba40bc0d0165d0513d6ca95282b1021e6a) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsGuiPlugin.cs (.../RingtoetsGuiPlugin.cs) (revision fd98bcf5d1811dbcad2cc0e292a4349f8402b83a) @@ -172,7 +172,7 @@ { Text = assessmentSection => assessmentSection.Name, Image = assessmentSection => RingtoetsFormsResources.AssessmentSectionFolderIcon, - EnsureVisibleOnCreate = assessmentSection => true, + EnsureVisibleOnCreate = (assessmentSection, parent) => true, ChildNodeObjects = AssessmentSectionChildNodeObjects, ContextMenuStrip = AssessmentSectionContextMenuStrip, CanRename = (assessmentSection, parentData) => true, Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/AssessmentSectionTreeNodeInfoTest.cs =================================================================== diff -u -rfec99b77571cc0cf37b60f5ca257394714fde1d7 -rfd98bcf5d1811dbcad2cc0e292a4349f8402b83a --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/AssessmentSectionTreeNodeInfoTest.cs (.../AssessmentSectionTreeNodeInfoTest.cs) (revision fec99b77571cc0cf37b60f5ca257394714fde1d7) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/AssessmentSectionTreeNodeInfoTest.cs (.../AssessmentSectionTreeNodeInfoTest.cs) (revision fd98bcf5d1811dbcad2cc0e292a4349f8402b83a) @@ -123,21 +123,16 @@ public void EnsureVisibleOnCreate_Always_ReturnsTrue() { // Setup - var assessmentSection = mocks.StrictMock(); - - mocks.ReplayAll(); - using (var plugin = new RingtoetsGuiPlugin()) { var info = GetInfo(plugin); // Call - var result = info.EnsureVisibleOnCreate(assessmentSection); + var result = info.EnsureVisibleOnCreate(null, null); // Assert Assert.IsTrue(result); } - mocks.VerifyAll(); } [Test] Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -r6dbb29ed12c28b66db763ff603f3ab8e28a0adf4 -rfd98bcf5d1811dbcad2cc0e292a4349f8402b83a --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 6dbb29ed12c28b66db763ff603f3ab8e28a0adf4) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision fd98bcf5d1811dbcad2cc0e292a4349f8402b83a) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// Runtime Version:4.0.30319.34209 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -622,7 +622,7 @@ } /// - /// Looks up a localized string similar to Genereer scenario's.... + /// Looks up a localized string similar to Genereer &scenario's.... /// public static string PipingCalculationGroup_Generate_PipingCalculations { get { Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.resx =================================================================== diff -u -r6dbb29ed12c28b66db763ff603f3ab8e28a0adf4 -rfd98bcf5d1811dbcad2cc0e292a4349f8402b83a --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.resx (.../Resources.resx) (revision 6dbb29ed12c28b66db763ff603f3ab8e28a0adf4) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.resx (.../Resources.resx) (revision fd98bcf5d1811dbcad2cc0e292a4349f8402b83a) @@ -692,7 +692,7 @@ ..\resources\wand-hat.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - Genereer scenario's... + Genereer &scenario's... Genereer scenario's op basis van geselecteerde profielschematisaties. Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingCalculationsView.resx =================================================================== diff -u -r7b59ab6aaa9f81445151848d8b3aa651062ee6b7 -rfd98bcf5d1811dbcad2cc0e292a4349f8402b83a --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingCalculationsView.resx (.../PipingCalculationsView.resx) (revision 7b59ab6aaa9f81445151848d8b3aa651062ee6b7) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingCalculationsView.resx (.../PipingCalculationsView.resx) (revision fd98bcf5d1811dbcad2cc0e292a4349f8402b83a) @@ -376,7 +376,7 @@ 0 - Genereer scenario's... + Genereer &scenario's... buttonGenerateScenarios @@ -483,9 +483,9 @@ <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="splitContainer" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="tableLayoutPanel1" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100" /><Rows Styles="Percent,100,Absolute,32" /></TableLayoutSettings> - + True - + 6, 13 Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingGuiPlugin.cs =================================================================== diff -u -r6dbb29ed12c28b66db763ff603f3ab8e28a0adf4 -rfd98bcf5d1811dbcad2cc0e292a4349f8402b83a --- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingGuiPlugin.cs (.../PipingGuiPlugin.cs) (revision 6dbb29ed12c28b66db763ff603f3ab8e28a0adf4) +++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingGuiPlugin.cs (.../PipingGuiPlugin.cs) (revision fd98bcf5d1811dbcad2cc0e292a4349f8402b83a) @@ -112,7 +112,7 @@ { Text = pipingCalculationContext => pipingCalculationContext.WrappedData.Name, Image = pipingCalculationContext => PipingFormsResources.PipingIcon, - EnsureVisibleOnCreate = pipingCalculationContext => true, + EnsureVisibleOnCreate = (pipingCalculationContext, parent) => true, ContextMenuStrip = PipingCalculationContextContextMenuStrip, ChildNodeObjects = PipingCalculationContextChildNodeObjects, CanRename = (pipingCalculationContext, parentData) => true, Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingCalculationScenarioContextTreeNodeInfoTest.cs =================================================================== diff -u -r23a37b025a5d0358c1f30fb31de41a2c284519a5 -rfd98bcf5d1811dbcad2cc0e292a4349f8402b83a --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingCalculationScenarioContextTreeNodeInfoTest.cs (.../PipingCalculationScenarioContextTreeNodeInfoTest.cs) (revision 23a37b025a5d0358c1f30fb31de41a2c284519a5) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingCalculationScenarioContextTreeNodeInfoTest.cs (.../PipingCalculationScenarioContextTreeNodeInfoTest.cs) (revision fd98bcf5d1811dbcad2cc0e292a4349f8402b83a) @@ -104,32 +104,8 @@ [Test] public void EnsureVisibleOnCreate_Always_ReturnsTrue() { - // Setup - var calculation = new PipingCalculationScenario(new GeneralPipingInput(), new NormProbabilityPipingInput()) - { - Output = new PipingOutput(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) - }; - - var pipingFailureMechanismMock = mocks.StrictMock(); - var assessmentSectionMock = mocks.StrictMock(); - mocks.ReplayAll(); - - var pipingCalculationContext = new PipingCalculationScenarioContext(calculation, - new[] - { - new RingtoetsPipingSurfaceLine() - }, - new[] - { - new TestStochasticSoilModel() - }, - pipingFailureMechanismMock, - assessmentSectionMock); - - mocks.ReplayAll(); - // Call - var result = info.EnsureVisibleOnCreate(pipingCalculationContext); + var result = info.EnsureVisibleOnCreate(null, null); // Assert Assert.IsTrue(result);