Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsGuiPlugin.cs =================================================================== diff -u -r7553a8467cc0e92de7af361cefaee1da29d1283a -r684b8c0ca681ea2da3cc988bd60e9223037e5a16 --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsGuiPlugin.cs (.../RingtoetsGuiPlugin.cs) (revision 7553a8467cc0e92de7af361cefaee1da29d1283a) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsGuiPlugin.cs (.../RingtoetsGuiPlugin.cs) (revision 684b8c0ca681ea2da3cc988bd60e9223037e5a16) @@ -26,6 +26,7 @@ using System.IO; using System.Linq; using System.Windows.Forms; + using Core.Common.Base.Data; using Core.Common.Controls.TreeView; using Core.Common.Gui; @@ -34,12 +35,15 @@ using Core.Common.Gui.Forms.ProgressDialog; using Core.Common.Gui.Plugin; using Core.Common.IO.Exceptions; + using log4net; + using Ringtoets.Common.Data; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.Contribution; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Forms.PresentationObjects; +using Ringtoets.Common.Forms.TreeNodeInfos; using Ringtoets.Common.Forms.Views; using Ringtoets.Common.Placeholder; using Ringtoets.GrassCoverErosionInwards.Data; @@ -58,6 +62,7 @@ using Ringtoets.Integration.Plugin.Properties; using Ringtoets.Piping.Data; using Ringtoets.Piping.Forms.PresentationObjects; + using RingtoetsDataResources = Ringtoets.Integration.Data.Properties.Resources; using RingtoetsFormsResources = Ringtoets.Integration.Forms.Properties.Resources; using RingtoetsCommonDataResources = Ringtoets.Common.Data.Properties.Resources; @@ -167,7 +172,7 @@ Text = assessmentSection => assessmentSection.Name, Image = assessmentSection => RingtoetsFormsResources.AssessmentSectionFolderIcon, EnsureVisibleOnCreate = assessmentSection => true, - ChildNodeObjects = assessmentSectionChildNodeObjects, + ChildNodeObjects = AssessmentSectionChildNodeObjects, ContextMenuStrip = AssessmentSectionContextMenuStrip, CanRename = (assessmentSection, parentData) => true, OnNodeRenamed = AssessmentSectionOnNodeRenamed, @@ -186,14 +191,10 @@ Gui.Get(nodeData, treeViewControl).AddImportItem().Build() }; - yield return new TreeNodeInfo - { - Text = failureMechanismPlaceholder => failureMechanismPlaceholder.WrappedData.Name, - Image = failureMechanismPlaceholder => RingtoetsFormsResources.FailureMechanismIcon, - ForeColor = failureMechanismPlaceholder => Color.FromKnownColor(KnownColor.GrayText), - ChildNodeObjects = FailureMechanismPlaceholderChildNodeObjects, - ContextMenuStrip = FailureMechanismPlaceholderContextMenuStrip - }; + yield return new DefaultFailureMechanismTreeNodeInfo( + FailureMechanismPlaceholderChildNodeObjects, + FailureMechanismPlaceholderContextMenuStrip, + Gui); yield return new TreeNodeInfo { @@ -379,7 +380,7 @@ # region assessmentSection - private object[] assessmentSectionChildNodeObjects(IAssessmentSection nodeData) + private object[] AssessmentSectionChildNodeObjects(IAssessmentSection nodeData) { var childNodes = new List { @@ -389,7 +390,7 @@ new CommentContext(nodeData) }; - var failureMechanismContexts = WrapFailureMechanismsInContexts(nodeData); + IEnumerable failureMechanismContexts = WrapFailureMechanismsInContexts(nodeData); childNodes.AddRange(failureMechanismContexts); return childNodes.ToArray(); @@ -429,7 +430,7 @@ private void AssessmentSectionOnNodeRemoved(IAssessmentSection nodeData, object parentNodeData) { - var parentProject = (Project) parentNodeData; + var parentProject = (Project)parentNodeData; parentProject.Items.Remove(nodeData); parentProject.NotifyObservers(); @@ -610,7 +611,7 @@ var designWaterLevelItem = new StrictContextMenuItem( RingtoetsFormsResources.DesignWaterLevel_Calculate, RingtoetsFormsResources.DesignWaterLevel_Calculate_ToolTip, - RingtoetsFormsResources.FailureMechanismIcon, + RingtoetsCommonFormsResources.FailureMechanismIcon, (sender, args) => { var hrdFile = nodeData.Parent.HydraulicBoundaryDatabase.FilePath; @@ -715,7 +716,7 @@ assessmentSection.Name, // TODO: Provide name of reference line instead HydraRingTimeIntegrationSchemeType.FBC, HydraRingUncertaintiesType.All, - new AssessmentLevelCalculationInput((int) hydraulicBoundaryLocation.Id, assessmentSection.FailureMechanismContribution.Norm), + new AssessmentLevelCalculationInput((int)hydraulicBoundaryLocation.Id, assessmentSection.FailureMechanismContribution.Norm), output => { ParseHydraRingOutput(hydraulicBoundaryLocation, output); }); }