Ejemplo n.º 1
0
        //----------------------------------------------------------------------
        public virtual DragDropEffects GetDragDropEffect(DragEventArgs e)
        {
            IDataObject data = e.Data;
            CCustomizableListDragDropData custData = data.GetData(typeof(CCustomizableListDragDropData)) as CCustomizableListDragDropData;

            if (custData != null && custData.ListControl == this)
            {
                return(DragDropEffects.Move);
            }
            return(DragDropEffects.None);
        }
Ejemplo n.º 2
0
        //----------------------------------------------------------------------
        protected virtual void m_panelDessin_DragDrop(object sender, DragEventArgs e)
        {
            CCustomizableListDragDropData data = e.Data.GetData(typeof(CCustomizableListDragDropData)) as CCustomizableListDragDropData;

            if (data != null && !LockEdition)
            {
                Point pt = new Point(e.X, e.Y);
                pt = m_panelDessin.PointToClient(pt);
                bool bIsAvant   = false;
                int? nIndexDest = GetIndexDragDrop(pt, ref bIsAvant);
                if (nIndexDest != null)
                {
                    CurrentItemIndex = null;
                    int nIndexSource = data.DraggedIndex;
                    MoveItem(nIndexSource, nIndexDest.Value, bIsAvant);
                }
            }
            HideHighlight();
            m_panelDessin.Refresh();
        }