Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Plugin/HeightStructuresGuiPlugin.cs =================================================================== diff -u -r585c9f51efb215f4ead02e4b2c9a69d51fbfd07c -ra4982cc86750add1301faf5f3411a58c960a5e6d --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Plugin/HeightStructuresGuiPlugin.cs (.../HeightStructuresGuiPlugin.cs) (revision 585c9f51efb215f4ead02e4b2c9a69d51fbfd07c) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Plugin/HeightStructuresGuiPlugin.cs (.../HeightStructuresGuiPlugin.cs) (revision a4982cc86750add1301faf5f3411a58c960a5e6d) @@ -19,13 +19,19 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System.Collections; using System.Collections.Generic; using System.Windows.Forms; using Core.Common.Controls.TreeView; using Core.Common.Gui.Plugin; +using Ringtoets.Common.Data; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Forms.PresentationObjects; using Ringtoets.Common.Forms.TreeNodeInfos; using Ringtoets.HeightStructures.Data; using Ringtoets.HeightStructures.Forms.PresentationObjects; +using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; namespace Ringtoets.HeightStructures.Plugin { @@ -37,10 +43,49 @@ public override IEnumerable GetTreeNodeInfos() { yield return RingtoetsTreeNodeInfoFactory.CreateFailureMechanismContextTreeNodeInfo( - context => new object[0], - context => new object[0], + FailureMechanismEnabledChildNodeObjects, + FailureMechanismDisabledChildNodeObjects, (context, o, treeViewControl) => new ContextMenuStrip(), (context, o, treeViewControl) => new ContextMenuStrip()); } + + #region HeightStructuresFailureMechanismContext TreeNodeInfo + + private object[] FailureMechanismEnabledChildNodeObjects(HeightStructuresFailureMechanismContext context) + { + HeightStructuresFailureMechanism wrappedData = context.WrappedData; + return new object[] + { + new CategoryTreeFolder(RingtoetsCommonFormsResources.FailureMechanism_Inputs_DisplayName, GetInputs(wrappedData, context.Parent), TreeFolderCategory.Input), + new CategoryTreeFolder(RingtoetsCommonFormsResources.FailureMechanism_Outputs_DisplayName, GetOutputs(wrappedData), TreeFolderCategory.Output) + }; + } + + private object[] FailureMechanismDisabledChildNodeObjects(HeightStructuresFailureMechanismContext context) + { + return new object[] + { + new CommentContext(context.WrappedData) + }; + } + + private static IList GetInputs(HeightStructuresFailureMechanism failureMechanism, IAssessmentSection assessmentSection) + { + return new ArrayList + { + new FailureMechanismSectionsContext(failureMechanism, assessmentSection), + new CommentContext(failureMechanism) + }; + } + + private static IList GetOutputs(HeightStructuresFailureMechanism failureMechanism) + { + return new ArrayList + { + new FailureMechanismSectionResultContext(failureMechanism.SectionResults, failureMechanism) + }; + } + + #endregion } } \ No newline at end of file