Index: Core/Common/src/Core.Common.Controls.TreeView/TreeNodeInfo.cs =================================================================== diff -u -r7022a5fcf668ebe36c390563d5ed82ca4c0fc016 -r778cb6e89f676cb60f95da71d7aed9d5b355ed2e --- Core/Common/src/Core.Common.Controls.TreeView/TreeNodeInfo.cs (.../TreeNodeInfo.cs) (revision 7022a5fcf668ebe36c390563d5ed82ca4c0fc016) +++ Core/Common/src/Core.Common.Controls.TreeView/TreeNodeInfo.cs (.../TreeNodeInfo.cs) (revision 778cb6e89f676cb60f95da71d7aed9d5b355ed2e) @@ -160,7 +160,7 @@ /// Gets or sets a function for obtaining the tree node foreground color. /// The parameter represents the wrapped data of the tree node. /// - public Func ForegroundColor { get; set; } + public Func ForegroundColor { get; set; } /// /// Gets or sets a function for obtaining the tree node image. Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingGuiPlugin.cs =================================================================== diff -u -r7022a5fcf668ebe36c390563d5ed82ca4c0fc016 -r778cb6e89f676cb60f95da71d7aed9d5b355ed2e --- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingGuiPlugin.cs (.../PipingGuiPlugin.cs) (revision 7022a5fcf668ebe36c390563d5ed82ca4c0fc016) +++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingGuiPlugin.cs (.../PipingGuiPlugin.cs) (revision 778cb6e89f676cb60f95da71d7aed9d5b355ed2e) @@ -1,6 +1,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Drawing; using System.Linq; using System.Windows.Forms; using Core.Common.Controls.TreeView; @@ -112,6 +113,112 @@ CanInsert = PipingCalculationGroupContextCanInsert, OnDrop = PipingCalculationGroupContextOnDrop }; + + yield return new TreeNodeInfo + { + Text = pipingInputContext => PipingFormsResources.PipingInputContextNodePresenter_NodeDisplayName, + Image = pipingInputContext => PipingFormsResources.PipingInputIcon, + ContextMenu = (nodeData, node) => Gui.ContextMenuProvider + .Get(node) + .AddImportItem() + .AddExportItem() + .AddSeparator() + .AddPropertiesItem() + .Build() + }; + + yield return new TreeNodeInfo> + { + Text = ringtoetsPipingSurfaceLine => PipingFormsResources.PipingSurfaceLinesCollection_DisplayName, + Image = ringtoetsPipingSurfaceLine => PipingFormsResources.FolderIcon, + ForegroundColor = ringtoetsPipingSurfaceLine => ringtoetsPipingSurfaceLine.Any() ? Color.FromKnownColor(KnownColor.ControlText) : Color.FromKnownColor(KnownColor.GrayText), + ChildNodeObjects = ringtoetsPipingSurfaceLine => ringtoetsPipingSurfaceLine.Cast().ToArray(), + ContextMenu = (nodeData, node) => Gui.ContextMenuProvider + .Get(node) + .AddImportItem() + .AddExportItem() + .AddSeparator() + .AddExpandAllItem() + .AddCollapseAllItem() + .Build() + }; + + yield return new TreeNodeInfo + { + Text = pipingSurfaceLine => pipingSurfaceLine.Name, + Image = pipingSurfaceLine => PipingFormsResources.PipingSurfaceLineIcon, + + ContextMenu = (nodeData, node) => Gui.ContextMenuProvider + .Get(node) + .AddPropertiesItem() + .Build() + }; + + yield return new TreeNodeInfo> + { + Text = pipingSoilProfiles => PipingFormsResources.PipingSoilProfilesCollection_DisplayName, + Image = pipingSoilProfiles => PipingFormsResources.FolderIcon, + ForegroundColor = pipingSoilProfiles => pipingSoilProfiles.Any() ? Color.FromKnownColor(KnownColor.ControlText) : Color.FromKnownColor(KnownColor.GrayText), + ChildNodeObjects = pipingSoilProfiles => pipingSoilProfiles.Cast().ToArray(), + ContextMenu = (nodeData, node) => Gui.ContextMenuProvider + .Get(node) + .AddImportItem() + .AddExportItem() + .AddSeparator() + .AddExpandAllItem() + .AddCollapseAllItem() + .Build() + }; + + yield return new TreeNodeInfo + { + Text = pipingSoilProfile => pipingSoilProfile.Name, + Image = pipingSoilProfile => PipingFormsResources.PipingSoilProfileIcon, + ContextMenu = (nodeData, node) => Gui.ContextMenuProvider + .Get(node) + .AddPropertiesItem() + .Build() + }; + + yield return new TreeNodeInfo + { + Text = pipingOutput => PipingFormsResources.PipingOutput_DisplayName, + Image = pipingOutput => PipingFormsResources.PipingOutputIcon, + ContextMenu = (nodeData, node) => Gui.ContextMenuProvider + .Get(node) + .AddExportItem() + .AddSeparator() + .AddPropertiesItem() + .Build() + }; + + yield return new TreeNodeInfo + { + Text = emptyPipingOutput => PipingFormsResources.PipingOutput_DisplayName, + Image = emptyPipingOutput => PipingFormsResources.PipingOutputIcon, + ForegroundColor = emptyPipingOutput => Color.FromKnownColor(KnownColor.GrayText), + ContextMenu = (nodeData, node) => Gui.ContextMenuProvider + .Get(node) + .AddExportItem() + .AddSeparator() + .AddPropertiesItem() + .Build() + }; + + yield return new TreeNodeInfo + { + Text = emptyPipingCalculationReport => PipingDataResources.CalculationReport_DisplayName, + Image = emptyPipingCalculationReport => PipingFormsResources.PipingCalculationReportIcon, + ForegroundColor = emptyPipingCalculationReport => Color.FromKnownColor(KnownColor.GrayText), + ContextMenu = (nodeData, node) => Gui.ContextMenuProvider + .Get(node) + .AddOpenItem() + .AddSeparator() + .AddExportItem() + .AddSeparator() + .AddPropertiesItem() + .Build() + }; } # region PipingFailureMechanism TreeNodeInfo