Index: Core/Common/src/Core.Common.Controls.TreeView/TreeNodeInfo.cs
===================================================================
diff -u -r2c8ad1caa67a3ce2e5cae4086c8b4e7938fe5dac -rbae40734343b0c77e11199210e39d75abb25c817
--- Core/Common/src/Core.Common.Controls.TreeView/TreeNodeInfo.cs (.../TreeNodeInfo.cs) (revision 2c8ad1caa67a3ce2e5cae4086c8b4e7938fe5dac)
+++ Core/Common/src/Core.Common.Controls.TreeView/TreeNodeInfo.cs (.../TreeNodeInfo.cs) (revision bae40734343b0c77e11199210e39d75abb25c817)
@@ -1,5 +1,6 @@
using System;
using System.Drawing;
+using System.Windows.Forms;
namespace Core.Common.Controls.TreeView
{
@@ -92,8 +93,26 @@
/// The parameter represents the type of drag operation that was performed.
/// The parameter represents the drop target index which the tree node was inserted at.
///
- /// When dragging a node, the function of the of the drop target should be called.
- public Action OnDragDrop { get; set; }
+ /// When dragging a node, the function of the of the drop target should be called.
+ public Action OnDrop { get; set; }
+
+ ///
+ /// Gets or sets a function for obtaining the tree node context menu.
+ /// The object parameter represents the wrapped data of the tree node.
+ ///
+ public Func ContextMenu { get; set; }
+
+ ///
+ /// Gets or sets a function for checking whether or not the tree node can be removed.
+ /// The object parameter represents the wrapped data of the tree node.
+ ///
+ public Func CanRemove { get; set; }
+
+ ///
+ /// Gets or sets an action for obtaining the logic to perform after removing the tree node.
+ /// The object parameter represents the wrapped data of the tree node.
+ ///
+ public Action OnNodeRemoved { get; set; }
}
///
@@ -192,10 +211,28 @@
/// The parameter represents the type of drag operation that was performed.
/// The parameter represents the drop target index which the tree node was inserted at.
///
- /// When dragging a node, the function of the of the drop target should be called.
- public Action OnDragDrop { get; set; }
+ /// When dragging a node, the function of the of the drop target should be called.
+ public Action OnDrop { get; set; }
///
+ /// Gets or sets a function for obtaining the tree node context menu.
+ /// The parameter represents the wrapped data of the tree node.
+ ///
+ public Func ContextMenu { get; set; }
+
+ ///
+ /// Gets or sets a function for checking whether or not the tree node can be removed.
+ /// The parameter represents the wrapped data of the tree node.
+ ///
+ public Func CanRemove { get; set; }
+
+ ///
+ /// Gets or sets an action for obtaining the logic to perform after removing the tree node.
+ /// The parameter represents the wrapped data of the tree node.
+ ///
+ public Action OnNodeRemoved { get; set; }
+
+ ///
/// This operator converts a into a .
///
/// The to convert.
@@ -212,7 +249,12 @@
OnNodeRenamed = (tag, name) => treeNodeInfo.OnNodeRenamed((TData) tag, name),
OnNodeChecked = (tag, checkedState) => treeNodeInfo.OnNodeChecked((TData) tag, checkedState),
CanDrag = tag => treeNodeInfo.CanDrag((TData) tag),
- CanDrop = (tag, sourceNode, targetNode, dragOperations) => treeNodeInfo.CanDrop((TData) tag, sourceNode, targetNode, dragOperations)
+ CanDrop = (tag, sourceNode, targetNode, dragOperations) => treeNodeInfo.CanDrop((TData) tag, sourceNode, targetNode, dragOperations),
+ CanInsert = (tag, sourceNode, targetNode) => treeNodeInfo.CanInsert((TData) tag, sourceNode, targetNode),
+ OnDrop = (tag, sourceNode, targetNode, dragOperations, index) => treeNodeInfo.OnDrop((TData) tag, sourceNode, targetNode, dragOperations, index),
+ ContextMenu = tag => treeNodeInfo.ContextMenu((TData) tag),
+ CanRemove = tag => treeNodeInfo.CanRemove((TData) tag),
+ OnNodeRemoved = tag => treeNodeInfo.OnNodeRemoved((TData) tag)
};
}
}