Treelist父节点上下移
/// <summary> /// 节点上移 /// </summary> /// <param name="node"></param> private void SetTreeNodeUp(TreeListNode node) { if(node == null) { return; } var parent = node.ParentNode; if (parent == null) { var index = trlsMonitor.GetNodeIndex(node); trlsMonitor.SetNodeIndex(node, index - 1); } else { var index = trlsMonitor.GetNodeIndex(parent); trlsMonitor.SetNodeIndex(parent, index - 1); } }
/// <summary> /// 节点下移 /// </summary> /// <param name="node"></param> private void SetTreeNodeDown(TreeListNode node) { if (node == null) { return; } var parent = node.ParentNode; if (parent == null) { var index = trlsMonitor.GetNodeIndex(node); trlsMonitor.SetNodeIndex(node, index + 1); } else { var index = trlsMonitor.GetNodeIndex(parent); trlsMonitor.SetNodeIndex(parent, index + 1); } }
量变会引起质变。