コード例 #1
0
        private void List_Drop(object sender, DragEventArgs e)
        {
            var pt = e.GetPosition(this);

            if (Math.Abs(pt.Y - _prewPt.Y) < 10)
            {
                return;
            }
            if (TagGrp == null)
            {
                return;
            }
            var tagWrap = e.Data.GetData(typeof(TagWrap)) as TagWrap;
            var mode    = DragProcessor.GetDragMode(e);

            if (tagWrap != null)
            {
                if (DragTo == null) // перетащили на пустое место
                {
                    TagGrp.TagList.Add(new TagWrap()
                    {
                        Tag = tagWrap.Tag
                    });
                    if (!CopyMode)
                    {
                        tagWrap.Tag = new Tag();
                    }
                }
                else
                {
                    if (SwapMode)
                    {
                        tagWrap.SwapWith(DragTo, mode);
                    }
                    else
                    {
                        TagWrap newTag = new TagWrap();
                        int     pos    = TagGrp.TagList.IndexOf(DragTo);
                        if (pos == -1)
                        {
                            pos = 0;
                        }
                        newTag.SwapWith(tagWrap, mode);
                        TagGrp.TagList.Insert(pos, newTag);
                    }
                }
            }

            else
            {
                DragProcessor.DragNodes(DragTo, e);
            }
        }
コード例 #2
0
        private void On_Drop(object sender, DragEventArgs e)
        {
            var data = e.Data.GetData(typeof(DragProcessor.DragElement)) as DragProcessor.DragElement;

            if (data == null || data.FirstElement == null)
            {
                return;
            }
            if (data.FirstElement.GetType() == typeof(Node))
            {
                DragProcessor.DoDrag(sender, e);
                e.Handled = true;
            }
        }
コード例 #3
0
        private void NodeList_Drop(object sender, DragEventArgs e)
        {
            var pt = e.GetPosition(this);

            if (Math.Abs(pt.Y - _prewPt.Y) < 10)
            {
                return;
            }
            var secondTag = e.Data.GetData(typeof(TagWrap)) as TagWrap;
            var mode      = DragProcessor.GetDragMode(e);

            if (secondTag != null)
            {
                CurTag.SwapWith(secondTag, mode);
            }
            DragProcessor.DragNodes(CurTag, e, _droppedNode);
        }
コード例 #4
0
 private void Tag00_OnDrop(object sender, DragEventArgs e)
 {
     DragProcessor.DoDrag(this, e);
 }
コード例 #5
0
 private void On_Drop(object sender, DragEventArgs e)
 {
     DragProcessor.DoDrag(ctrlField, e);
 }