예제 #1
0
        protected virtual List <RadTreeNode> GetDraggedNodes(RadTreeNode draggedNode)
        {
            SelectedTreeNodeCollection selectedNodes = draggedNode.TreeViewElement.SelectedNodes;
            List <RadTreeNode>         result        = new List <RadTreeNode>();
            bool isDraggable = true;

            foreach (RadTreeNode node in selectedNodes)
            {
                RadTreeNode parent = node.Parent;
                isDraggable = true;

                while (parent != null)
                {
                    if (parent.Selected)
                    {
                        isDraggable = false;
                        break;
                    }

                    parent = parent.Parent;
                }

                if (isDraggable)
                {
                    result.Add(node);
                }
            }

            if (result.Count == 0)
            {
                result.Add(draggedNode);
            }

            return(result);
        }
예제 #2
0
        protected virtual List <RadTreeNode> GetDraggedNodes(RadTreeNode draggedNode)
        {
            SelectedTreeNodeCollection selectedNodes   = draggedNode.TreeViewElement.SelectedNodes;
            List <RadTreeNode>         radTreeNodeList = new List <RadTreeNode>();

            foreach (RadTreeNode radTreeNode in (ReadOnlyCollection <RadTreeNode>)selectedNodes)
            {
                RadTreeNode parent = radTreeNode.Parent;
                bool        flag   = true;
                for (; parent != null; parent = parent.Parent)
                {
                    if (parent.Selected)
                    {
                        flag = false;
                        break;
                    }
                }
                if (flag)
                {
                    radTreeNodeList.Add(radTreeNode);
                }
            }
            if (radTreeNodeList.Count == 0)
            {
                radTreeNodeList.Add(draggedNode);
            }
            return(radTreeNodeList);
        }
예제 #3
0
        protected virtual List <RadTreeNode> GetSelectedNodes(RadTreeNode draggedNode)
        {
            SelectedTreeNodeCollection selectedNodes   = draggedNode.TreeViewElement.SelectedNodes;
            List <RadTreeNode>         radTreeNodeList = new List <RadTreeNode>();

            foreach (RadTreeNode radTreeNode in (ReadOnlyCollection <RadTreeNode>)selectedNodes)
            {
                radTreeNodeList.Add(radTreeNode);
            }
            return(radTreeNodeList);
        }