private static void RunActionInPostOrderRecursion <T>(this T node, TreeNodeAction <T> action, int h, int x) where T : ITreeNode <T> { int i = 0; foreach (var item in node.Children) { item.RunActionInPostOrderRecursion(action, h + 1, i); i++; } action(node, h, x); }
public void ProcessDependencyTreeNodes(TreeNodeAction treeNodeAction, TreeNode parentNode = null) { if (parentNode == null) { foreach (TreeNode treeNode in treeView_DependencyTree.Nodes) { ProcessDependencyTreeNodes(treeNodeAction, treeNode); } } else { treeNodeAction(parentNode); foreach (TreeNode treeNode in parentNode.Nodes) { ProcessDependencyTreeNodes(treeNodeAction, treeNode); } } }
//Format: {<nodeAction>;<index>;<action name>;<action count>},{action1},{action3} private static List <TreeNodeAction> getTreeNodeActionListFromDataStr(string actionListStr) { List <TreeNodeAction> actionList = new List <TreeNodeAction>(); List <string> actionSplitList = actionListStr.Split(',').ToList(); foreach (var actionStr in actionSplitList) { var fieldSplitList = ParseHelper.getSplitListInBlock(actionStr, ";", "{", "}"); if (fieldSplitList.Count > 2) { TreeNodeAction tempAction = new TreeNodeAction() { actionType = getNodeActionTypeFromStr(fieldSplitList[0]), index = Int64.Parse(fieldSplitList[1]), actionName = fieldSplitList[2], count = Int32.Parse(fieldSplitList[3]) }; actionList.Add(tempAction); } } return(actionList); }
//Format: {<nodeAction>;<index>;<action name>;<action count>},{action1},{action3} private static List<TreeNodeAction> getTreeNodeActionListFromDataStr(string actionListStr) { List<TreeNodeAction> actionList = new List<TreeNodeAction>(); List<string> actionSplitList = actionListStr.Split(',').ToList(); foreach (var actionStr in actionSplitList) { var fieldSplitList = ParseHelper.getSplitListInBlock(actionStr, ";", "{", "}"); if(fieldSplitList.Count > 2){ TreeNodeAction tempAction = new TreeNodeAction() { actionType = getNodeActionTypeFromStr(fieldSplitList[0]), index = Int64.Parse(fieldSplitList[1]), actionName = fieldSplitList[2], count = Int32.Parse(fieldSplitList[3]) }; actionList.Add(tempAction); } } return actionList; }
public static void MoveTo(this TreeNode node, TreeNode treeNode, TreeNodeAction action) { }
/// <summary> /// Initializes the object. /// </summary> public TreeNodeActionEventArgs(TreeNodeAction action, object node, object parent) { m_node = node; m_parent = parent; m_action = action; }
public static void RunActionInPostOrder <T>(this T node, TreeNodeAction <T> action) where T : ITreeNode <T> { node.RunActionInPostOrderRecursion <T>(action, 0, 0); }
public TreeNodeEventArgs(TreeNode node, TreeNodeAction action) : base() { _node = node; _action = action; }
public TreeNodeMouseEventArgs(TreeNode node, TreeNodeAction action, MouseEventArgs e) : base() { _node = node; _action = action; _e = e; }