Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 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);
         }
     }
 }
Exemplo n.º 3
0
    //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);
    }
Exemplo n.º 4
0
    //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;
    }
Exemplo n.º 5
0
 public static void MoveTo(this TreeNode node, TreeNode treeNode, TreeNodeAction action)
 {
 }
Exemplo n.º 6
0
 /// <summary>
 /// Initializes the object.
 /// </summary>
 public TreeNodeActionEventArgs(TreeNodeAction action, object node, object parent)
 {
     m_node   = node;
     m_parent = parent;
     m_action = action;
 }
Exemplo n.º 7
0
        /// <summary>
        /// Initializes the object.
        /// </summary>
		public TreeNodeActionEventArgs(TreeNodeAction action, object node, object parent)
		{
			m_node   = node;
            m_parent = parent;
			m_action = action;
		}
Exemplo n.º 8
0
 public static void RunActionInPostOrder <T>(this T node, TreeNodeAction <T> action) where T : ITreeNode <T>
 {
     node.RunActionInPostOrderRecursion <T>(action, 0, 0);
 }
Exemplo n.º 9
0
 public TreeNodeEventArgs(TreeNode node, TreeNodeAction action) : base()
 {
     _node   = node;
     _action = action;
 }
Exemplo n.º 10
0
 public TreeNodeMouseEventArgs(TreeNode node, TreeNodeAction action, MouseEventArgs e) : base()
 {
     _node   = node;
     _action = action;
     _e      = e;
 }