Index: src/Common/DelftTools.Controls.Swf/Charting/ChartView.Designer.cs =================================================================== diff -u -r8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9 -rfa9b36343401d44cb6813d7871903782d0dedec9 --- src/Common/DelftTools.Controls.Swf/Charting/ChartView.Designer.cs (.../ChartView.Designer.cs) (revision 8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9) +++ src/Common/DelftTools.Controls.Swf/Charting/ChartView.Designer.cs (.../ChartView.Designer.cs) (revision fa9b36343401d44cb6813d7871903782d0dedec9) @@ -63,7 +63,6 @@ } #endregion - private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; private DeltaShellTChart teeChart; private System.Windows.Forms.Timer timer1; } Index: src/Common/DelftTools.Controls.Swf/Charting/ChartView.cs =================================================================== diff -u -r367570aed0000b2f1bf6ed9e98385a47f4302e85 -rfa9b36343401d44cb6813d7871903782d0dedec9 --- src/Common/DelftTools.Controls.Swf/Charting/ChartView.cs (.../ChartView.cs) (revision 367570aed0000b2f1bf6ed9e98385a47f4302e85) +++ src/Common/DelftTools.Controls.Swf/Charting/ChartView.cs (.../ChartView.cs) (revision fa9b36343401d44cb6813d7871903782d0dedec9) @@ -551,7 +551,7 @@ return; } - var contextMenu = contextMenuStrip1 ?? new ContextMenuStrip(); + var contextMenu = new ContextMenuStrip(); if (e.Button == MouseButtons.Right) { foreach (IChartViewContextMenuTool tool in Tools.Where(tool => tool is IChartViewContextMenuTool && tool.Active)) Index: src/Common/DelftTools.Controls.Swf/DelftTools.Controls.Swf.csproj =================================================================== diff -u -r2d05e18d1fcde2d8d00d2434a6e560d65337d2f7 -rfa9b36343401d44cb6813d7871903782d0dedec9 --- src/Common/DelftTools.Controls.Swf/DelftTools.Controls.Swf.csproj (.../DelftTools.Controls.Swf.csproj) (revision 2d05e18d1fcde2d8d00d2434a6e560d65337d2f7) +++ src/Common/DelftTools.Controls.Swf/DelftTools.Controls.Swf.csproj (.../DelftTools.Controls.Swf.csproj) (revision fa9b36343401d44cb6813d7871903782d0dedec9) @@ -294,8 +294,6 @@ InputTextDialog.cs - - Form Fisheye: Tag fa9b36343401d44cb6813d7871903782d0dedec9 refers to a dead (removed) revision in file `src/Common/DelftTools.Controls.Swf/MenuItemContextMenuStripAdapter.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag fa9b36343401d44cb6813d7871903782d0dedec9 refers to a dead (removed) revision in file `src/Common/DelftTools.Controls.Swf/MenuItemToolStripMenuItemAdapter.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: src/Common/DelftTools.Controls.Swf/TreeViewControls/TreeNode.cs =================================================================== diff -u -re9ccb6e01ef8be942a76e62d937b995797ecbc7f -rfa9b36343401d44cb6813d7871903782d0dedec9 --- src/Common/DelftTools.Controls.Swf/TreeViewControls/TreeNode.cs (.../TreeNode.cs) (revision e9ccb6e01ef8be942a76e62d937b995797ecbc7f) +++ src/Common/DelftTools.Controls.Swf/TreeViewControls/TreeNode.cs (.../TreeNode.cs) (revision fa9b36343401d44cb6813d7871903782d0dedec9) @@ -14,7 +14,6 @@ private readonly TreeNodeList nodes; private readonly ITreeView treeView; protected bool isLoaded; - private IMenuItem contextMenu; private object tag; @@ -26,44 +25,22 @@ nodes = new TreeNodeList(base.Nodes); IsVisible = true; } - + /// /// Called when a user right clicks in the network tree /// public override ContextMenuStrip ContextMenuStrip { get { - ITreeNodePresenter treeNodePresenter = Presenter; - if (treeNodePresenter == null) - { - log.WarnFormat("No treeNodePresenter for node: {0}", this); - return null; - } - - IMenuItem contextMenu = treeNodePresenter.GetContextMenu(this, Tag); - if (contextMenu == null) - { - //log.WarnFormat("No contextmenu found for node: {0}", this); - return null; - } - - var adapter = contextMenu as MenuItemContextMenuStripAdapter; - if (adapter == null) - { - log.WarnFormat( - "Only ContextMenuStrip-adapted IMenuItems are supported as a context menu for now. Node: {0}, Menu: {1}", - this, contextMenu); - return null; - } - return adapter.ContextMenuStrip; + return Presenter != null ? Presenter.GetContextMenu(this, Tag) : null; } set { base.ContextMenuStrip = value; } } - + /// /// Used in rendering (has children indicates if a plus or minus must be drawn) /// @@ -79,32 +56,6 @@ public ITreeNodePresenter Presenter { get; set; } - public new IMenuItem ContextMenu - { - get - { - return contextMenu; - } - set - { - if (null == value) - { - //log.WarnFormat("No contextmenu set for : {0}", this); - return; - } - var adapter = value as MenuItemContextMenuStripAdapter; - if (adapter == null) - { - log.WarnFormat( - "Only ContextMenuStrip-adapted IMenuItems are supported as a context menu for now. Node: {0}, Menu: {1}", - this, contextMenu); - return; - } - base.ContextMenuStrip = adapter.ContextMenuStrip; - contextMenu = value; - } - } - public new string Text { get @@ -215,14 +166,6 @@ } } - public Rectangle Bounds - { - get - { - return base.Bounds; - } - } - public bool IsLoaded { get Index: src/Common/DelftTools.Controls.Swf/TreeViewControls/TreeViewNodePresenterBase.cs =================================================================== diff -u -r55748a3add7607a81a8116d2d249787df907dab5 -rfa9b36343401d44cb6813d7871903782d0dedec9 --- src/Common/DelftTools.Controls.Swf/TreeViewControls/TreeViewNodePresenterBase.cs (.../TreeViewNodePresenterBase.cs) (revision 55748a3add7607a81a8116d2d249787df907dab5) +++ src/Common/DelftTools.Controls.Swf/TreeViewControls/TreeViewNodePresenterBase.cs (.../TreeViewNodePresenterBase.cs) (revision fa9b36343401d44cb6813d7871903782d0dedec9) @@ -162,7 +162,7 @@ throw new NotImplementedException(); } - public virtual IMenuItem GetContextMenu(ITreeNode sender, object nodeData) + public virtual ContextMenuStrip GetContextMenu(ITreeNode sender, object nodeData) { return null; } @@ -290,7 +290,7 @@ // create and add a new tree node var newNode = TreeView.AddNewNode(parentNode, e.Item, newNodeIndex); - newNode.ContextMenu = GetContextMenu(null, e.Item); + newNode.ContextMenuStrip = GetContextMenu(null, e.Item); } else { Index: src/Common/DelftTools.Controls/DelftTools.Controls.csproj =================================================================== diff -u -r426da1b8715bb37b1bc570b71ed86e84438f24cf -rfa9b36343401d44cb6813d7871903782d0dedec9 --- src/Common/DelftTools.Controls/DelftTools.Controls.csproj (.../DelftTools.Controls.csproj) (revision 426da1b8715bb37b1bc570b71ed86e84438f24cf) +++ src/Common/DelftTools.Controls/DelftTools.Controls.csproj (.../DelftTools.Controls.csproj) (revision fa9b36343401d44cb6813d7871903782d0dedec9) @@ -84,8 +84,6 @@ - - Fisheye: Tag fa9b36343401d44cb6813d7871903782d0dedec9 refers to a dead (removed) revision in file `src/Common/DelftTools.Controls/IMenuItem.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag fa9b36343401d44cb6813d7871903782d0dedec9 refers to a dead (removed) revision in file `src/Common/DelftTools.Controls/IMenuItemCollection.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: src/Common/DelftTools.Controls/ITreeNode.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -rfa9b36343401d44cb6813d7871903782d0dedec9 --- src/Common/DelftTools.Controls/ITreeNode.cs (.../ITreeNode.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/Common/DelftTools.Controls/ITreeNode.cs (.../ITreeNode.cs) (revision fa9b36343401d44cb6813d7871903782d0dedec9) @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Drawing; +using System.Windows.Forms; namespace DelftTools.Controls { @@ -27,7 +28,7 @@ /// /// Gets the shortcut menu associated with this tree node. /// - IMenuItem ContextMenu { get; set; } + ContextMenuStrip ContextMenuStrip { get; set; } /// /// Gets or sets a value that indicates whether a check box is displayed next to the node @@ -172,6 +173,7 @@ ITreeNode GetParentOfLevel(int level); void ShowContextMenu(Point location); - new void EnsureVisible(); + + void EnsureVisible(); } } \ No newline at end of file Index: src/Common/DelftTools.Controls/ITreeNodePresenter.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -rfa9b36343401d44cb6813d7871903782d0dedec9 --- src/Common/DelftTools.Controls/ITreeNodePresenter.cs (.../ITreeNodePresenter.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/Common/DelftTools.Controls/ITreeNodePresenter.cs (.../ITreeNodePresenter.cs) (revision fa9b36343401d44cb6813d7871903782d0dedec9) @@ -1,6 +1,7 @@ using System; using System.Collections; using System.ComponentModel; +using System.Windows.Forms; using DelftTools.Utils.Collections; namespace DelftTools.Controls @@ -135,12 +136,10 @@ /// void OnNodeSelected(object nodeData); - // TODO: change it to IMenuItem - /// /// Returns context menu based on current data /// - IMenuItem GetContextMenu(ITreeNode sender, object nodeData); + ContextMenuStrip GetContextMenu(ITreeNode sender, object nodeData); /// /// Updates node due to it's property change. Index: src/Common/DelftTools.Shell.Gui.Swf/TreeViewNodePresenterBaseForPluginGui.cs =================================================================== diff -u -r2d05e18d1fcde2d8d00d2434a6e560d65337d2f7 -rfa9b36343401d44cb6813d7871903782d0dedec9 --- src/Common/DelftTools.Shell.Gui.Swf/TreeViewNodePresenterBaseForPluginGui.cs (.../TreeViewNodePresenterBaseForPluginGui.cs) (revision 2d05e18d1fcde2d8d00d2434a6e560d65337d2f7) +++ src/Common/DelftTools.Shell.Gui.Swf/TreeViewNodePresenterBaseForPluginGui.cs (.../TreeViewNodePresenterBaseForPluginGui.cs) (revision fa9b36343401d44cb6813d7871903782d0dedec9) @@ -1,3 +1,4 @@ +using System.Windows.Forms; using DelftTools.Controls; using DelftTools.Controls.Swf.TreeViewControls; @@ -18,7 +19,7 @@ public GuiPlugin GuiPlugin { get; set; } - public override IMenuItem GetContextMenu(ITreeNode sender, object nodeData) + public override ContextMenuStrip GetContextMenu(ITreeNode sender, object nodeData) { if (GuiPlugin == null) { Index: src/Common/DelftTools.Shell.Gui/DelftTools.Shell.Gui.csproj =================================================================== diff -u -r426da1b8715bb37b1bc570b71ed86e84438f24cf -rfa9b36343401d44cb6813d7871903782d0dedec9 --- src/Common/DelftTools.Shell.Gui/DelftTools.Shell.Gui.csproj (.../DelftTools.Shell.Gui.csproj) (revision 426da1b8715bb37b1bc570b71ed86e84438f24cf) +++ src/Common/DelftTools.Shell.Gui/DelftTools.Shell.Gui.csproj (.../DelftTools.Shell.Gui.csproj) (revision fa9b36343401d44cb6813d7871903782d0dedec9) @@ -84,6 +84,7 @@ 3.5 + @@ -196,7 +197,6 @@ - Index: src/Common/DelftTools.Shell.Gui/GuiPlugin.cs =================================================================== diff -u -rc014322084de9f6669b76623b458cb9e16e427a4 -rfa9b36343401d44cb6813d7871903782d0dedec9 --- src/Common/DelftTools.Shell.Gui/GuiPlugin.cs (.../GuiPlugin.cs) (revision c014322084de9f6669b76623b458cb9e16e427a4) +++ src/Common/DelftTools.Shell.Gui/GuiPlugin.cs (.../GuiPlugin.cs) (revision fa9b36343401d44cb6813d7871903782d0dedec9) @@ -4,6 +4,7 @@ using System.Linq; using System.Reflection; using System.Resources; +using System.Windows.Forms; using DelftTools.Controls; using DelftTools.Shell.Core; using DelftTools.Shell.Gui.Forms; @@ -120,7 +121,7 @@ /// /// /// - public virtual IMenuItem GetContextMenu(object sender, object data) + public virtual ContextMenuStrip GetContextMenu(object sender, object data) { return null; } Index: src/DeltaShell/DeltaShell.Plugins.CommonTools.Gui/Forms/Charting/ChartSeriesTreeNodePresenter.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -rfa9b36343401d44cb6813d7871903782d0dedec9 --- src/DeltaShell/DeltaShell.Plugins.CommonTools.Gui/Forms/Charting/ChartSeriesTreeNodePresenter.cs (.../ChartSeriesTreeNodePresenter.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/DeltaShell/DeltaShell.Plugins.CommonTools.Gui/Forms/Charting/ChartSeriesTreeNodePresenter.cs (.../ChartSeriesTreeNodePresenter.cs) (revision fa9b36343401d44cb6813d7871903782d0dedec9) @@ -33,7 +33,7 @@ node.Tag = chartSeries; node.Checked = chartSeries.Visible; node.ShowCheckBox = true; - node.ContextMenu = GetContextMenu(null, chartSeries); + node.ContextMenuStrip = GetContextMenu(null, chartSeries); node.Image = GetImage(chartSeries); } Index: src/DeltaShell/DeltaShell.Plugins.CommonTools.Gui/Forms/Charting/ChartTreeNodePresenter.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -rfa9b36343401d44cb6813d7871903782d0dedec9 --- src/DeltaShell/DeltaShell.Plugins.CommonTools.Gui/Forms/Charting/ChartTreeNodePresenter.cs (.../ChartTreeNodePresenter.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/DeltaShell/DeltaShell.Plugins.CommonTools.Gui/Forms/Charting/ChartTreeNodePresenter.cs (.../ChartTreeNodePresenter.cs) (revision fa9b36343401d44cb6813d7871903782d0dedec9) @@ -22,7 +22,7 @@ node.Tag = chart; node.Text = string.IsNullOrEmpty(chart.Title) ? Resources.ChartTreeNodePresenter_UpdateNode_Chart : chart.Title; node.Image = Resources.Chart; - node.ContextMenu = GetContextMenu(null, chart); + node.ContextMenuStrip = GetContextMenu(null, chart); } public override IEnumerable GetChildNodeObjects(IChart chart, ITreeNode node) Index: src/DeltaShell/DeltaShell.Plugins.ProjectExplorer/ProjectExplorer.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -rfa9b36343401d44cb6813d7871903782d0dedec9 --- src/DeltaShell/DeltaShell.Plugins.ProjectExplorer/ProjectExplorer.cs (.../ProjectExplorer.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/DeltaShell/DeltaShell.Plugins.ProjectExplorer/ProjectExplorer.cs (.../ProjectExplorer.cs) (revision fa9b36343401d44cb6813d7871903782d0dedec9) @@ -84,7 +84,7 @@ base.Dispose(); } - public IMenuItem GetContextMenu(ITreeNode sender, object o) + public ContextMenuStrip GetContextMenu(ITreeNode sender, object o) { return ProjectTreeView.GetContextMenu(o); } Index: src/DeltaShell/DeltaShell.Plugins.ProjectExplorer/ProjectExplorerGuiPlugin.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -rfa9b36343401d44cb6813d7871903782d0dedec9 --- src/DeltaShell/DeltaShell.Plugins.ProjectExplorer/ProjectExplorerGuiPlugin.cs (.../ProjectExplorerGuiPlugin.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/DeltaShell/DeltaShell.Plugins.ProjectExplorer/ProjectExplorerGuiPlugin.cs (.../ProjectExplorerGuiPlugin.cs) (revision fa9b36343401d44cb6813d7871903782d0dedec9) @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Drawing; using System.Linq; +using System.Windows.Forms; using DelftTools.Controls; using DelftTools.Shell.Core; using DelftTools.Shell.Gui; @@ -136,9 +137,9 @@ } /// - /// TODO: refactor it to IMenuItem + /// /// - public override IMenuItem GetContextMenu(object sender, object nodeTag) + public override ContextMenuStrip GetContextMenu(object sender, object nodeTag) { return ProjectExplorer != null ? ProjectExplorer.ProjectTreeView.GetContextMenu(nodeTag) : null; } Index: src/DeltaShell/DeltaShell.Plugins.ProjectExplorer/ProjectTreeView.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -rfa9b36343401d44cb6813d7871903782d0dedec9 --- src/DeltaShell/DeltaShell.Plugins.ProjectExplorer/ProjectTreeView.cs (.../ProjectTreeView.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/DeltaShell/DeltaShell.Plugins.ProjectExplorer/ProjectTreeView.cs (.../ProjectTreeView.cs) (revision fa9b36343401d44cb6813d7871903782d0dedec9) @@ -3,7 +3,6 @@ using System.Linq; using System.Windows.Forms; using DelftTools.Controls; -using DelftTools.Controls.Swf; using DelftTools.Shell.Core; using DelftTools.Shell.Gui; using DelftTools.Utils.Aop; @@ -125,7 +124,7 @@ public Image Image { get; set; } public ViewInfo ViewInfo { get; set; } - public IMenuItem GetContextMenu(object nodeTag) + public ContextMenuStrip GetContextMenu(object nodeTag) { //TODO: let go of menu's here but compose a menu on the fly based on selection. if (nodeTag is Project) @@ -139,7 +138,7 @@ buttonFolderImportFolder.Enabled = gui.CommandHandler.CanImportToGuiSelection(); - return new MenuItemContextMenuStripAdapter(contextMenuFolder); + return contextMenuFolder; } return null; Index: src/DeltaShell/DeltaShell.Plugins.SharpMapGis.Gui/Forms/MapLegendView/MapLayerTreeViewNodePresenter.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -rfa9b36343401d44cb6813d7871903782d0dedec9 --- src/DeltaShell/DeltaShell.Plugins.SharpMapGis.Gui/Forms/MapLegendView/MapLayerTreeViewNodePresenter.cs (.../MapLayerTreeViewNodePresenter.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/DeltaShell/DeltaShell.Plugins.SharpMapGis.Gui/Forms/MapLegendView/MapLayerTreeViewNodePresenter.cs (.../MapLayerTreeViewNodePresenter.cs) (revision fa9b36343401d44cb6813d7871903782d0dedec9) @@ -36,7 +36,7 @@ node.Text = layer.Name; node.Checked = layer.Visible; node.ShowCheckBox = true; - node.ContextMenu = GetContextMenu(null, layer); + node.ContextMenuStrip = GetContextMenu(null, layer); node.IsVisible = layer.ShowInTreeView; } Index: src/DeltaShell/DeltaShell.Plugins.SharpMapGis.Gui/Forms/MapLegendView/MapLegendView.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -rfa9b36343401d44cb6813d7871903782d0dedec9 --- src/DeltaShell/DeltaShell.Plugins.SharpMapGis.Gui/Forms/MapLegendView/MapLegendView.cs (.../MapLegendView.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/DeltaShell/DeltaShell.Plugins.SharpMapGis.Gui/Forms/MapLegendView/MapLegendView.cs (.../MapLegendView.cs) (revision fa9b36343401d44cb6813d7871903782d0dedec9) @@ -24,7 +24,7 @@ public partial class MapLegendView : UserControl, IView { private static readonly ILog Log = LogManager.GetLogger(typeof(MapLegendView)); - private readonly IGui gui; //HACK: remove gui reference + private readonly IGui gui; private readonly IGisGuiService gisService; public Action OnOpenLayerAttributeTable = layer => { }; @@ -108,21 +108,19 @@ public ViewInfo ViewInfo { get; set; } - // TODO,HACK: these clicking methods below should be moved to service/command handlers - - public IMenuItem GetContextMenu(object nodeTag) + public ContextMenuStrip GetContextMenu(object nodeTag) { if (nodeTag is Layer) { - return new MenuItemContextMenuStripAdapter(contextMenuLayer); + return contextMenuLayer; } if (nodeTag is Client.WmsServerLayer) { - return new MenuItemContextMenuStripAdapter(contextMenuWmsLayer); + return contextMenuWmsLayer; } if (nodeTag is Map) { - return new MenuItemContextMenuStripAdapter(contextMenuMap); + return contextMenuMap; } return null; Index: src/DeltaShell/DeltaShell.Plugins.SharpMapGis.Gui/SharpMapGisGuiPlugin.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -rfa9b36343401d44cb6813d7871903782d0dedec9 --- src/DeltaShell/DeltaShell.Plugins.SharpMapGis.Gui/SharpMapGisGuiPlugin.cs (.../SharpMapGisGuiPlugin.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/DeltaShell/DeltaShell.Plugins.SharpMapGis.Gui/SharpMapGisGuiPlugin.cs (.../SharpMapGisGuiPlugin.cs) (revision fa9b36343401d44cb6813d7871903782d0dedec9) @@ -347,12 +347,12 @@ }; } - public override IMenuItem GetContextMenu(object sender, object data) + public override ContextMenuStrip GetContextMenu(object sender, object data) { //custom treenodes for maplegend view if (sender is TreeNode) { - var treeNode = (TreeNode) sender; + var treeNode = (TreeNode)sender; if (treeNode.TreeView.Parent == mapLegendView) { return mapLegendView != null ? mapLegendView.GetContextMenu(data) : null; Index: src/Plugins/Wti/Wti.Forms/NodePresenters/PipingDataNodePresenter.cs =================================================================== diff -u -rfe0228504fc61d6af56be4c0f6a8fc28690f9064 -rfa9b36343401d44cb6813d7871903782d0dedec9 --- src/Plugins/Wti/Wti.Forms/NodePresenters/PipingDataNodePresenter.cs (.../PipingDataNodePresenter.cs) (revision fe0228504fc61d6af56be4c0f6a8fc28690f9064) +++ src/Plugins/Wti/Wti.Forms/NodePresenters/PipingDataNodePresenter.cs (.../PipingDataNodePresenter.cs) (revision fa9b36343401d44cb6813d7871903782d0dedec9) @@ -1,8 +1,8 @@ using System; using System.Collections; using System.ComponentModel; +using System.Windows.Forms; using DelftTools.Controls; -using DelftTools.Controls.Swf; using DelftTools.Utils.Collections; using Wti.Data; using Wti.Forms.Properties; @@ -77,15 +77,14 @@ public void OnNodeSelected(object nodeData) {} - public IMenuItem GetContextMenu(ITreeNode sender, object nodeData) + public ContextMenuStrip GetContextMenu(ITreeNode sender, object nodeData) { var contextMenu = new PipingContextMenuStrip((PipingData) nodeData); - var contextMenuAdapter = new MenuItemContextMenuStripAdapter(contextMenu); contextMenu.OnCalculationClick += PerformPipingCalculation; contextMenu.OnValidationClick += PerformPipingValidation; - return contextMenuAdapter; + return contextMenu; } public void OnPropertyChanged(object sender, ITreeNode node, PropertyChangedEventArgs e) {} Index: src/Plugins/Wti/Wti.Forms/NodePresenters/PipingFailureMechanismNodePresenter.cs =================================================================== diff -u -rab8c3b732c3aaadc8e55be98e132bdaf41110169 -rfa9b36343401d44cb6813d7871903782d0dedec9 --- src/Plugins/Wti/Wti.Forms/NodePresenters/PipingFailureMechanismNodePresenter.cs (.../PipingFailureMechanismNodePresenter.cs) (revision ab8c3b732c3aaadc8e55be98e132bdaf41110169) +++ src/Plugins/Wti/Wti.Forms/NodePresenters/PipingFailureMechanismNodePresenter.cs (.../PipingFailureMechanismNodePresenter.cs) (revision fa9b36343401d44cb6813d7871903782d0dedec9) @@ -1,10 +1,9 @@ using System; using System.Collections; using System.ComponentModel; - +using System.Windows.Forms; using DelftTools.Controls; using DelftTools.Utils.Collections; - using Wti.Data; using Wti.Forms.Properties; @@ -76,7 +75,7 @@ public void OnNodeSelected(object nodeData) {} - public IMenuItem GetContextMenu(ITreeNode sender, object nodeData) + public ContextMenuStrip GetContextMenu(ITreeNode sender, object nodeData) { return null; } Index: src/Plugins/Wti/Wti.Forms/NodePresenters/PipingNodePresenterBase.cs =================================================================== diff -u -rab8c3b732c3aaadc8e55be98e132bdaf41110169 -rfa9b36343401d44cb6813d7871903782d0dedec9 --- src/Plugins/Wti/Wti.Forms/NodePresenters/PipingNodePresenterBase.cs (.../PipingNodePresenterBase.cs) (revision ab8c3b732c3aaadc8e55be98e132bdaf41110169) +++ src/Plugins/Wti/Wti.Forms/NodePresenters/PipingNodePresenterBase.cs (.../PipingNodePresenterBase.cs) (revision fa9b36343401d44cb6813d7871903782d0dedec9) @@ -2,7 +2,7 @@ using System.Collections; using System.ComponentModel; using System.Linq; - +using System.Windows.Forms; using DelftTools.Controls; using DelftTools.Utils.Collections; @@ -81,7 +81,7 @@ OnNodeSelected((T)nodeData); } - public IMenuItem GetContextMenu(ITreeNode sender, object nodeData) + public ContextMenuStrip GetContextMenu(ITreeNode sender, object nodeData) { return GetContextMenu(sender, (T)nodeData); } @@ -109,13 +109,13 @@ /// /// Typed implementation method of . /// - /// + /// protected abstract void UpdateNode(ITreeNode parentNode, ITreeNode node, T nodeData); /// /// Typed implementation method of . /// - /// + /// protected virtual IEnumerable GetChildNodeObjects(T nodeData, ITreeNode node) { return Enumerable.Empty(); @@ -124,7 +124,7 @@ /// /// Typed implementation method of . /// - /// + /// protected virtual void OnNodeRenamed(T nodeData, string newName) { throw new InvalidOperationException(string.Format("Cannot rename tree node of type {0}.", GetType().Name)); @@ -133,7 +133,7 @@ /// /// Typed implementation method of . /// - /// + /// protected virtual DragOperations CanDrag(T nodeData) { return DragOperations.None; @@ -142,7 +142,7 @@ /// /// Typed implementation method of . /// - /// + /// protected virtual DragOperations CanDrop(T item, ITreeNode sourceNode, ITreeNode targetNode, DragOperations validOperations) { return DragOperations.None; @@ -151,7 +151,7 @@ /// /// Typed implementation method of . /// - /// + /// protected virtual bool CanInsert(T item, ITreeNode sourceNode, ITreeNode targetNode) { return false; @@ -160,7 +160,7 @@ /// /// Typed implementation method of . /// - /// + /// protected virtual void OnDragDrop(T item, object sourceParentNodeData, object targetParentNodeData, DragOperations operation, int position) { // Do nothing @@ -169,7 +169,7 @@ /// /// Typed implementation method of . /// - /// + /// protected virtual void OnNodeSelected(T nodeData) { // Do nothing @@ -178,16 +178,16 @@ /// /// Typed implementation method of . /// - /// - protected virtual IMenuItem GetContextMenu(ITreeNode sender, T nodeData) + /// + protected virtual ContextMenuStrip GetContextMenu(ITreeNode sender, T nodeData) { return null; } /// /// Typed implementation method of . /// - /// + /// protected virtual void OnPropertyChanged(T sender, ITreeNode node, PropertyChangedEventArgs e) { // Do nothing @@ -196,7 +196,7 @@ /// /// Typed implementation method of . /// - /// + /// protected virtual void OnCollectionChanged(T sender, NotifyCollectionChangingEventArgs e) { // Do nothing @@ -205,7 +205,7 @@ /// /// Typed implementation method of . /// - /// + /// protected virtual bool CanRemove(object parentNodeData, T nodeData) { return false; @@ -214,7 +214,7 @@ /// /// Typed implementation method of . /// - /// + /// protected virtual bool RemoveNodeData(object parentNodeData, T nodeData) { throw new InvalidOperationException(String.Format("Cannot delete node of type {0}.", GetType().Name)); Index: src/Plugins/Wti/Wti.Forms/NodePresenters/PipingOutputNodePresenter.cs =================================================================== diff -u -rbbc44cc497cf85875585c8aad671c49b6de4fbc3 -rfa9b36343401d44cb6813d7871903782d0dedec9 --- src/Plugins/Wti/Wti.Forms/NodePresenters/PipingOutputNodePresenter.cs (.../PipingOutputNodePresenter.cs) (revision bbc44cc497cf85875585c8aad671c49b6de4fbc3) +++ src/Plugins/Wti/Wti.Forms/NodePresenters/PipingOutputNodePresenter.cs (.../PipingOutputNodePresenter.cs) (revision fa9b36343401d44cb6813d7871903782d0dedec9) @@ -1,6 +1,7 @@ using System; using System.Collections; using System.ComponentModel; +using System.Windows.Forms; using DelftTools.Controls; using DelftTools.Utils.Collections; using Wti.Data; @@ -67,7 +68,7 @@ public void OnNodeSelected(object nodeData) {} - public IMenuItem GetContextMenu(ITreeNode sender, object nodeData) + public ContextMenuStrip GetContextMenu(ITreeNode sender, object nodeData) { return null; } Index: src/Plugins/Wti/Wti.Forms/NodePresenters/PipingSoilProfileCollectionNodePresenter.cs =================================================================== diff -u -r85de34918096850be7844fe93a73336cd7c29d3e -rfa9b36343401d44cb6813d7871903782d0dedec9 --- src/Plugins/Wti/Wti.Forms/NodePresenters/PipingSoilProfileCollectionNodePresenter.cs (.../PipingSoilProfileCollectionNodePresenter.cs) (revision 85de34918096850be7844fe93a73336cd7c29d3e) +++ src/Plugins/Wti/Wti.Forms/NodePresenters/PipingSoilProfileCollectionNodePresenter.cs (.../PipingSoilProfileCollectionNodePresenter.cs) (revision fa9b36343401d44cb6813d7871903782d0dedec9) @@ -5,7 +5,6 @@ using System.Drawing; using System.Windows.Forms; using DelftTools.Controls; -using DelftTools.Controls.Swf; using DelftTools.Utils.Collections; using Wti.Data; using Wti.Forms.Extensions; @@ -88,11 +87,11 @@ public void OnNodeSelected(object nodeData) {} - public IMenuItem GetContextMenu(ITreeNode sender, object nodeData) + public ContextMenuStrip GetContextMenu(ITreeNode sender, object nodeData) { if (ImportSoilProfilesAction != null) { - return new MenuItemContextMenuStripAdapter(CreateContextMenu()); + return CreateContextMenu(); } return null; } Index: src/Plugins/Wti/Wti.Forms/NodePresenters/PipingSurfaceLineCollectionNodePresenter.cs =================================================================== diff -u -rab8c3b732c3aaadc8e55be98e132bdaf41110169 -rfa9b36343401d44cb6813d7871903782d0dedec9 --- src/Plugins/Wti/Wti.Forms/NodePresenters/PipingSurfaceLineCollectionNodePresenter.cs (.../PipingSurfaceLineCollectionNodePresenter.cs) (revision ab8c3b732c3aaadc8e55be98e132bdaf41110169) +++ src/Plugins/Wti/Wti.Forms/NodePresenters/PipingSurfaceLineCollectionNodePresenter.cs (.../PipingSurfaceLineCollectionNodePresenter.cs) (revision fa9b36343401d44cb6813d7871903782d0dedec9) @@ -6,7 +6,6 @@ using System.Linq; using System.Windows.Forms; using DelftTools.Controls; -using DelftTools.Controls.Swf; using DelftTools.Utils.Collections; using Wti.Data; using Wti.Forms.Extensions; @@ -89,11 +88,11 @@ public void OnNodeSelected(object nodeData) {} - public IMenuItem GetContextMenu(ITreeNode sender, object nodeData) + public ContextMenuStrip GetContextMenu(ITreeNode sender, object nodeData) { if (ImportSurfaceLinesAction != null) { - return new MenuItemContextMenuStripAdapter(CreateContextMenu()); + return CreateContextMenu(); } return null; } Index: src/Plugins/Wti/Wti.Forms/NodePresenters/WtiProjectNodePresenter.cs =================================================================== diff -u -r97ebda114265b9ccdc6cf73bab8312e5422e3de4 -rfa9b36343401d44cb6813d7871903782d0dedec9 --- src/Plugins/Wti/Wti.Forms/NodePresenters/WtiProjectNodePresenter.cs (.../WtiProjectNodePresenter.cs) (revision 97ebda114265b9ccdc6cf73bab8312e5422e3de4) +++ src/Plugins/Wti/Wti.Forms/NodePresenters/WtiProjectNodePresenter.cs (.../WtiProjectNodePresenter.cs) (revision fa9b36343401d44cb6813d7871903782d0dedec9) @@ -3,7 +3,6 @@ using System.ComponentModel; using System.Windows.Forms; using DelftTools.Controls; -using DelftTools.Controls.Swf; using DelftTools.Shell.Core; using DelftTools.Utils.Collections; using Wti.Data; @@ -81,11 +80,10 @@ public void OnNodeSelected(object nodeData) {} - public IMenuItem GetContextMenu(ITreeNode sender, object nodeData) + public ContextMenuStrip GetContextMenu(ITreeNode sender, object nodeData) { var contextMenu = new ContextMenuStrip(); var addPipingFailureMechanismItem = contextMenu.Items.Add(Resources.AddPipingFailureMechanismContextMenuItem); - var contextMenuAdapter = new MenuItemContextMenuStripAdapter(contextMenu); var wtiProject = (WtiProject) nodeData; @@ -101,7 +99,7 @@ addPipingFailureMechanismItem.ToolTipText = Resources.WtiProjectTooltipPipingFailureMechanismAlreadyAdded; } - return contextMenuAdapter; + return contextMenu; } public void OnPropertyChanged(object sender, ITreeNode node, PropertyChangedEventArgs e) {} Fisheye: Tag fa9b36343401d44cb6813d7871903782d0dedec9 refers to a dead (removed) revision in file `test/Common/DelftTools.Tests/Controls/Swf/MenuItemContextMenuStripAdapterTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: test/Common/DelftTools.Tests/DelftTools.Tests.csproj =================================================================== diff -u -rab8c3b732c3aaadc8e55be98e132bdaf41110169 -rfa9b36343401d44cb6813d7871903782d0dedec9 --- test/Common/DelftTools.Tests/DelftTools.Tests.csproj (.../DelftTools.Tests.csproj) (revision ab8c3b732c3aaadc8e55be98e132bdaf41110169) +++ test/Common/DelftTools.Tests/DelftTools.Tests.csproj (.../DelftTools.Tests.csproj) (revision fa9b36343401d44cb6813d7871903782d0dedec9) @@ -111,7 +111,6 @@ - Index: test/Plugins/Wti/Wti.Forms.Test/NodePresenters/PipingDataNodePresenterTest.cs =================================================================== diff -u -r97ebda114265b9ccdc6cf73bab8312e5422e3de4 -rfa9b36343401d44cb6813d7871903782d0dedec9 --- test/Plugins/Wti/Wti.Forms.Test/NodePresenters/PipingDataNodePresenterTest.cs (.../PipingDataNodePresenterTest.cs) (revision 97ebda114265b9ccdc6cf73bab8312e5422e3de4) +++ test/Plugins/Wti/Wti.Forms.Test/NodePresenters/PipingDataNodePresenterTest.cs (.../PipingDataNodePresenterTest.cs) (revision fa9b36343401d44cb6813d7871903782d0dedec9) @@ -1,7 +1,6 @@ using System; using System.ComponentModel; using DelftTools.Controls; -using DelftTools.Controls.Swf; using DelftTools.Shell.Core; using DelftTools.TestUtils; using DelftTools.Utils.Collections; @@ -288,14 +287,14 @@ mocks.ReplayAll(); // Call - var contextMenu = nodePresenter.GetContextMenu(nodeMock, dataMock) as MenuItemContextMenuStripAdapter; + var contextMenu = nodePresenter.GetContextMenu(nodeMock, dataMock); // Assert Assert.IsNotNull(contextMenu); - Assert.AreEqual(2, contextMenu.ContextMenuStrip.Items.Count); - Assert.AreEqual(WtiFormsResources.PipingDataContextMenuCalculate, contextMenu.ContextMenuStrip.Items[1].Text); - Assert.AreEqual(WtiFormsResources.PipingDataContextMenuValidate, contextMenu.ContextMenuStrip.Items[0].Text); - Assert.IsInstanceOf(contextMenu.ContextMenuStrip); + Assert.AreEqual(2, contextMenu.Items.Count); + Assert.AreEqual(WtiFormsResources.PipingDataContextMenuCalculate, contextMenu.Items[1].Text); + Assert.AreEqual(WtiFormsResources.PipingDataContextMenuValidate, contextMenu.Items[0].Text); + Assert.IsInstanceOf(contextMenu); mocks.VerifyAll(); // Expect no calls on arguments } @@ -387,10 +386,10 @@ mockRepository.ReplayAll(); - var contextMenuAdapter = nodePresenter.GetContextMenu(null, pipingData) as MenuItemContextMenuStripAdapter; + var contextMenuAdapter = nodePresenter.GetContextMenu(null, pipingData); // When - Action action = () => contextMenuAdapter.ContextMenuStrip.Items[calculateContextMenuItemIndex].PerformClick(); + Action action = () => contextMenuAdapter.Items[calculateContextMenuItemIndex].PerformClick(); // Then TestHelper.AssertLogMessagesCount(action, expectedLogMessageCount); @@ -415,10 +414,10 @@ mockRepository.ReplayAll(); - var contextMenuAdapter = nodePresenter.GetContextMenu(null, pipingData) as MenuItemContextMenuStripAdapter; + var contextMenuAdapter = nodePresenter.GetContextMenu(null, pipingData); // When - Action action = () => contextMenuAdapter.ContextMenuStrip.Items[validateContextMenuItemIndex].PerformClick(); + Action action = () => contextMenuAdapter.Items[validateContextMenuItemIndex].PerformClick(); // Then TestHelper.AssertLogMessagesCount(action, expectedLogMessageCount); @@ -466,10 +465,10 @@ mockRepository.ReplayAll(); - var contextMenuAdapter = nodePresenter.GetContextMenu(null, pipingData) as MenuItemContextMenuStripAdapter; + var contextMenuAdapter = nodePresenter.GetContextMenu(null, pipingData); // When - Action action = () => contextMenuAdapter.ContextMenuStrip.Items[calculateContextMenuItemIndex].PerformClick(); + Action action = () => contextMenuAdapter.Items[calculateContextMenuItemIndex].PerformClick(); // Then TestHelper.AssertLogMessagesCount(action, expectedLogMessageCount); Index: test/Plugins/Wti/Wti.Forms.Test/NodePresenters/PipingOutputNodePresenterTest.cs =================================================================== diff -u -r8af9f2baf8d6ed5b2450bd9812328bf0efd7e339 -rfa9b36343401d44cb6813d7871903782d0dedec9 --- test/Plugins/Wti/Wti.Forms.Test/NodePresenters/PipingOutputNodePresenterTest.cs (.../PipingOutputNodePresenterTest.cs) (revision 8af9f2baf8d6ed5b2450bd9812328bf0efd7e339) +++ test/Plugins/Wti/Wti.Forms.Test/NodePresenters/PipingOutputNodePresenterTest.cs (.../PipingOutputNodePresenterTest.cs) (revision fa9b36343401d44cb6813d7871903782d0dedec9) @@ -1,5 +1,6 @@ using System; using System.ComponentModel; +using System.Windows.Forms; using DelftTools.Controls; using DelftTools.Utils.Collections; using NUnit.Framework; @@ -248,7 +249,7 @@ var nodePresenter = new PipingOutputNodePresenter(); // Call - IMenuItem contextMenu = nodePresenter.GetContextMenu(nodeMock, dataMock); + ContextMenuStrip contextMenu = nodePresenter.GetContextMenu(nodeMock, dataMock); // Assert Assert.IsNull(contextMenu); Index: test/Plugins/Wti/Wti.Forms.Test/NodePresenters/PipingSoilProfileCollectionNodePresenterTest.cs =================================================================== diff -u -r2d05e18d1fcde2d8d00d2434a6e560d65337d2f7 -rfa9b36343401d44cb6813d7871903782d0dedec9 --- test/Plugins/Wti/Wti.Forms.Test/NodePresenters/PipingSoilProfileCollectionNodePresenterTest.cs (.../PipingSoilProfileCollectionNodePresenterTest.cs) (revision 2d05e18d1fcde2d8d00d2434a6e560d65337d2f7) +++ test/Plugins/Wti/Wti.Forms.Test/NodePresenters/PipingSoilProfileCollectionNodePresenterTest.cs (.../PipingSoilProfileCollectionNodePresenterTest.cs) (revision fa9b36343401d44cb6813d7871903782d0dedec9) @@ -4,7 +4,6 @@ using System.Drawing; using System.Linq; using DelftTools.Controls; -using DelftTools.Controls.Swf; using DelftTools.Utils.Collections; using NUnit.Framework; using Rhino.Mocks; @@ -359,7 +358,7 @@ var returnedContextMenu = nodePresenter.GetContextMenu(nodeMock, dataMock); // Assert - var contextMenu = ((MenuItemContextMenuStripAdapter)returnedContextMenu).ContextMenuStrip; + var contextMenu = returnedContextMenu; Assert.AreEqual(1, contextMenu.Items.Count); var importItem = contextMenu.Items[0]; Assert.AreEqual("Importeer ondergrondprofielen", importItem.Text); Index: test/Plugins/Wti/Wti.Forms.Test/NodePresenters/PipingSurfaceLineCollectionNodePresenterTest.cs =================================================================== diff -u -r2d05e18d1fcde2d8d00d2434a6e560d65337d2f7 -rfa9b36343401d44cb6813d7871903782d0dedec9 --- test/Plugins/Wti/Wti.Forms.Test/NodePresenters/PipingSurfaceLineCollectionNodePresenterTest.cs (.../PipingSurfaceLineCollectionNodePresenterTest.cs) (revision 2d05e18d1fcde2d8d00d2434a6e560d65337d2f7) +++ test/Plugins/Wti/Wti.Forms.Test/NodePresenters/PipingSurfaceLineCollectionNodePresenterTest.cs (.../PipingSurfaceLineCollectionNodePresenterTest.cs) (revision fa9b36343401d44cb6813d7871903782d0dedec9) @@ -4,13 +4,9 @@ using System.Drawing; using System.Linq; using DelftTools.Controls; -using DelftTools.Controls.Swf; using DelftTools.Utils.Collections; - using NUnit.Framework; - using Rhino.Mocks; - using Wti.Data; using Wti.Forms.NodePresenters; @@ -309,7 +305,7 @@ var returnedContextMenu = nodePresenter.GetContextMenu(nodeMock, dataMock); // Assert - var contextMenu = ((MenuItemContextMenuStripAdapter)returnedContextMenu).ContextMenuStrip; + var contextMenu = returnedContextMenu; Assert.AreEqual(1, contextMenu.Items.Count); var importItem = contextMenu.Items[0]; Assert.AreEqual("Importeer dwarsdoorsnedes", importItem.Text); Index: test/Plugins/Wti/Wti.Forms.Test/NodePresenters/WtiProjectNodePresenterTest.cs =================================================================== diff -u -r97ebda114265b9ccdc6cf73bab8312e5422e3de4 -rfa9b36343401d44cb6813d7871903782d0dedec9 --- test/Plugins/Wti/Wti.Forms.Test/NodePresenters/WtiProjectNodePresenterTest.cs (.../WtiProjectNodePresenterTest.cs) (revision 97ebda114265b9ccdc6cf73bab8312e5422e3de4) +++ test/Plugins/Wti/Wti.Forms.Test/NodePresenters/WtiProjectNodePresenterTest.cs (.../WtiProjectNodePresenterTest.cs) (revision fa9b36343401d44cb6813d7871903782d0dedec9) @@ -1,7 +1,6 @@ using System.ComponentModel; using System.Linq; using DelftTools.Controls; -using DelftTools.Controls.Swf; using DelftTools.Shell.Core; using DelftTools.Utils.Collections; using NUnit.Framework; @@ -277,15 +276,15 @@ var nodePresenter = new WtiProjectNodePresenter(); // Call - var contextMenu = nodePresenter.GetContextMenu(nodeMock, wtiProject) as MenuItemContextMenuStripAdapter; + var contextMenu = nodePresenter.GetContextMenu(nodeMock, wtiProject); // Assert Assert.IsNotNull(contextMenu); - Assert.AreEqual(1, contextMenu.ContextMenuStrip.Items.Count); - Assert.AreEqual(WtiFormsResources.AddPipingFailureMechanismContextMenuItem, contextMenu.ContextMenuStrip.Items[0].Text); - Assert.AreEqual(WtiFormsResources.WtiProjectTooltipAddPipingFailureMechanism, contextMenu.ContextMenuStrip.Items[0].ToolTipText); - Assert.IsTrue(contextMenu.ContextMenuStrip.Items[0].Enabled); - Assert.AreSame(wtiProject, contextMenu.ContextMenuStrip.Items[0].Tag); + Assert.AreEqual(1, contextMenu.Items.Count); + Assert.AreEqual(WtiFormsResources.AddPipingFailureMechanismContextMenuItem, contextMenu.Items[0].Text); + Assert.AreEqual(WtiFormsResources.WtiProjectTooltipAddPipingFailureMechanism, contextMenu.Items[0].ToolTipText); + Assert.IsTrue(contextMenu.Items[0].Enabled); + Assert.AreSame(wtiProject, contextMenu.Items[0].Tag); mocks.VerifyAll(); // Expect no calls on arguments } @@ -302,15 +301,15 @@ var nodePresenter = new WtiProjectNodePresenter(); // Call - var contextMenu = nodePresenter.GetContextMenu(nodeMock, wtiProject) as MenuItemContextMenuStripAdapter; + var contextMenu = nodePresenter.GetContextMenu(nodeMock, wtiProject); // Assert Assert.IsNotNull(contextMenu); - Assert.AreEqual(1, contextMenu.ContextMenuStrip.Items.Count); - Assert.AreEqual(WtiFormsResources.AddPipingFailureMechanismContextMenuItem, contextMenu.ContextMenuStrip.Items[0].Text); - Assert.AreEqual(WtiFormsResources.WtiProjectTooltipPipingFailureMechanismAlreadyAdded, contextMenu.ContextMenuStrip.Items[0].ToolTipText); - Assert.IsFalse(contextMenu.ContextMenuStrip.Items[0].Enabled); - Assert.IsNull(contextMenu.ContextMenuStrip.Items[0].Tag); + Assert.AreEqual(1, contextMenu.Items.Count); + Assert.AreEqual(WtiFormsResources.AddPipingFailureMechanismContextMenuItem, contextMenu.Items[0].Text); + Assert.AreEqual(WtiFormsResources.WtiProjectTooltipPipingFailureMechanismAlreadyAdded, contextMenu.Items[0].ToolTipText); + Assert.IsFalse(contextMenu.Items[0].Enabled); + Assert.IsNull(contextMenu.Items[0].Tag); mocks.VerifyAll(); // Expect no calls on arguments } @@ -408,15 +407,15 @@ mocks.ReplayAll(); var nodePresenter = new WtiProjectNodePresenter(); - var contextMenu = nodePresenter.GetContextMenu(nodeMock, wtiProject) as MenuItemContextMenuStripAdapter; + var contextMenu = nodePresenter.GetContextMenu(nodeMock, wtiProject); // Preconditions Assert.IsNotNull(contextMenu); Assert.IsNull(wtiProject.PipingFailureMechanism); - Assert.AreEqual(1, contextMenu.ContextMenuStrip.Items.Count); + Assert.AreEqual(1, contextMenu.Items.Count); // Call - contextMenu.ContextMenuStrip.Items[0].PerformClick(); + contextMenu.Items[0].PerformClick(); // Assert Assert.IsNotNull(wtiProject.PipingFailureMechanism);