Esempio n. 1
0
        protected override void OnDragDrop(DragEventArgs e)
        {
            if (m_Moving != null)
            {
                m_Moving.ForeColor = m_MovingOriginalColour;
            }
            m_Indicator.Visible = false;

            if (!e.Data.GetDataPresent(typeof(TreeNode)))
            {
                return;
            }
            if (m_Moving == null || m_DropTarget == null)
            {
                return;
            }

            int newIndex = m_Moving.Parent.Nodes.IndexOf(m_DropTarget);

            if (newIndex < 0)
            {
                Utilities.LogSubError("TreeviewWithMove, target not found within parent");
                return;
            }
            NodeMoved?.Invoke(this, new MoveEventArgs(m_Moving, newIndex));
        }
Esempio n. 2
0
 internal void RaiseNodeMoved(Node n)
 {
     NodeMoved?.Invoke(n);
 }