Exemple #1
0
        void WhenDragOver(DragEventArgs e)
        {
            if (_manager == null)
            {
                return;
            }

            var point = treeView1.PointToClient(new Point(e.X, e.Y));
            var node  = treeView1.GetNodeAt(point);

            if (null == node)
            {
                return;
            }

            if (node.Tag is ProjectId)
            {
                var requestId = (string)e.Data.GetData(DataFormats.StringFormat);
                var projectId = (ProjectId)node.Tag;
                if (_manager.CanDropToProject(requestId, projectId))
                {
                    e.Effect = DragDropEffects.Move;
                }
                else
                {
                    e.Effect = DragDropEffects.None;
                }
            }
            else
            {
                e.Effect = DragDropEffects.None;
            }

            //
        }