Ejemplo n.º 1
0
        /// <summary>
        /// Called when the underlying tree control raises the DragOver event</summary>
        /// <param name="e">Event args from the tree control's DragOver event</param>
        protected virtual void OnDragOver(DragEventArgs e)
        {
            bool canInsert = false;

            if (TreeControl.DragBetween)
            {
                TreeControl.Node parent, before;
                Point            clientPoint = TreeControl.PointToClient(new Point(e.X, e.Y));
                if (TreeControl.GetInsertionNodes(clientPoint, out parent, out before))
                {
                    canInsert = ApplicationUtil.CanInsertBetween(
                        m_treeControlAdapter.TreeView,
                        parent != null ? parent.Tag : null,
                        before != null ? before.Tag : null,
                        e.Data);
                }
            }
            else
            {
                canInsert = ApplicationUtil.CanInsert(
                    m_treeControlAdapter.TreeView,
                    m_treeControlAdapter.LastHit,
                    e.Data);
            }



            e.Effect = canInsert ? DragDropEffects.Move : DragDropEffects.None;

            // A refresh is required to display the drag-between cue.
            if (TreeControl.ShowDragBetweenCue)
            {
                TreeControl.Invalidate();
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Called when the underlying ListView raises the DragOver event</summary>
 /// <param name="e">Event args from the ListView's DragOver event</param>
 protected virtual void OnDragOver(DragEventArgs e)
 {
     if (ApplicationUtil.CanInsert(m_listViewAdapter.ListView, null, e.Data))
     {
         e.Effect = DragDropEffects.Move;
     }
     else
     {
         e.Effect = DragDropEffects.None;
     }
 }
        /// <summary>
        /// Method triggered when DragOver event is fired on the TreeListView</summary>
        /// <param name="e">Drag-and-drop event arguments</param>
        protected virtual void OnDragOver(DragEventArgs e)
        {
            bool canInsert = false;

            try
            {
                canInsert = ApplicationUtil.CanInsert(View, LastHit, e.Data);
            }
            finally
            {
                e.Effect = canInsert ? DragDropEffects.Move : DragDropEffects.None;
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Called when the underlying tree control raises the DragOver event</summary>
        /// <param name="e">Event args from the tree control's DragOver event</param>
        protected virtual void OnDragOver(DragEventArgs e)
        {
            bool showDragBetweenCue = TreeControl.ShowDragBetweenCue;

            TreeControl.ShowDragBetweenCue = false;

            bool canInsert = ApplicationUtil.CanInsert(
                m_treeControlAdapter.TreeView,
                m_treeControlAdapter.LastHit,
                e.Data);

            e.Effect = canInsert ? DragDropEffects.Move : DragDropEffects.None;

            if (showDragBetweenCue != TreeControl.ShowDragBetweenCue)
            {
                TreeControl.Refresh();
            }
        }