System.Windows.Forms.Control.OnDragDrop(System.Windows.Forms.DragEventArgs)

Here are the examples of the csharp api class System.Windows.Forms.Control.OnDragDrop(System.Windows.Forms.DragEventArgs) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

48 Examples 7

1. Example

Project: ImageGlass
Source File: ImageListView.cs
protected override void OnDragDrop(DragEventArgs e)
        {
            navigationManager.DragDrop(e);
            base.OnDragDrop(e);
        }

2. Example

Project: tesvsnip
Source File: ObjectListView.cs
protected override void OnDragDrop(DragEventArgs args)
        {
            base.OnDragDrop(args);

            if (DropSink != null)
                DropSink.Drop(args);
        }

3. Example

Project: falloutsnip
Source File: ObjectListView.cs
protected override void OnDragDrop(DragEventArgs args)
        {
            base.OnDragDrop(args);

            if (DropSink != null)
                DropSink.Drop(args);
        }

4. Example

Project: ArnoldSimulator
Source File: GraphControl.cs
protected override void OnDragDrop(DragEventArgs drgevent)
		{
			base.OnDragDrop(drgevent);
		}

5. Example

Project: gitter
Source File: CustomListBox.cs
protected override void OnDragDrop(DragEventArgs drgevent)
		{
			StopScrollTimer();
			base.OnDragDrop(drgevent);
		}

6. Example

Project: logwizard
Source File: ObjectListView.cs
protected override void OnDragDrop(DragEventArgs args) {
            base.OnDragDrop(args);

            if (this.DropSink != null)
                this.DropSink.Drop(args);
        }

7. Example

Project: Bulk-Crap-Uninstaller
Source File: ObjectListView.cs
protected override void OnDragDrop(DragEventArgs args) {
            base.OnDragDrop(args);

            if (this.DropSink != null)
                this.DropSink.Drop(args);
        }

8. Example

Project: Graph
Source File: GraphControl.cs
protected override void OnDragDrop(DragEventArgs drgevent)
		{
			base.OnDragDrop(drgevent);
		}

9. Example

Project: ME3Explorer
Source File: PCanvas.cs
protected override void OnDragDrop(DragEventArgs drgevent) {
			base.OnDragDrop (drgevent);
			Root.DefaultInputManager.ProcessEventFromCamera(drgevent, PInputType.DragDrop, Camera, this);
		}

10. Example

Project: imagelistview
Source File: ImageListView.cs
protected override void OnDragDrop(DragEventArgs e)
        {
            navigationManager.DragDrop(e);
            base.OnDragDrop(e);
        }

11. Example

Project: ATF
Source File: GridControl.cs
private void gridView_DragDrop(object sender, DragEventArgs e)
        {
            // raise event on this control
            OnDragDrop(e);
        }

12. Example

Project: ATF
Source File: PropertyEditingControl.cs
private void textBox_DragDrop(object sender, DragEventArgs e)
        {
            // raise event on this control
            OnDragDrop(e);
        }

13. Example

Project: ATF
Source File: PropertyGrid.cs
private void propertyGrid_DragDrop(object sender, DragEventArgs e)
        {
            // raise event on this control
            OnDragDrop(e);
        }

14. Example

Project: ATF
Source File: DataBoundListView.cs
private void textBox_DragDrop(object sender, DragEventArgs e)
        {
            // raise event on this control
            OnDragDrop(e);
        }

15. Example

Project: SquareOne
Source File: ObjectListView.cs
protected override void OnDragDrop(DragEventArgs args) {
            base.OnDragDrop(args);

            if (this.DropSink != null)
                this.DropSink.Drop(args);
        }

16. Example

Project: MapViewer
Source File: ObjectListView.cs
protected override void OnDragDrop(DragEventArgs args) {
            base.OnDragDrop(args);

            if (this.DropSink != null)
                this.DropSink.Drop(args);
        }

17. Example

Project: referencesource
Source File: WorkflowView.cs
protected override void OnDragDrop(DragEventArgs dragEventArgs)
        {
            base.OnDragDrop(dragEventArgs);

            using (WorkflowMessageDispatchData dispatchData = new WorkflowMessageDispatchData(this, dragEventArgs))
            {
                foreach (WorkflowDesignerMessageFilter filter in dispatchData.Filters)
                {
                    if (((IWorkflowDesignerMessageSink)filter).OnDragDrop(dragEventArgs))
                        break;
                }
            }

            this.dragDropInProgress = false;
        }

18. Example

Project: ATF
Source File: TreeControl.cs
protected override void OnDragDrop(DragEventArgs e)
        {
            StopDragTimers();

            base.OnDragDrop(e);
            m_dragBetween = false; 
        }

19. Example

Project: ClearCanvas
Source File: TileControl.cs
protected override void OnDragDrop(DragEventArgs drgevent)
		{
			_tile.Select();

			MemorableUndoableCommand memorableCommand = new MemorableUndoableCommand(_tile.ParentImageBox);
			memorableCommand.BeginState = _tile.ParentImageBox.CreateMemento();

			IDisplaySet displaySet = (IDisplaySet) drgevent.Data.GetData(typeof (DisplaySet));
			_tile.ParentImageBox.DisplaySet = displaySet.CreateFreshCopy();
			_tile.ParentImageBox.Draw();

			memorableCommand.EndState = _tile.ParentImageBox.CreateMemento();

			DrawableUndoableCommand historyCommand = new DrawableUndoableCommand(_tile.ParentImageBox);
			historyCommand.Enqueue(memorableCommand);
			_tile.ImageViewer.CommandHistory.AddCommand(historyCommand);

			base.OnDragDrop(drgevent);
		}

20. Example

Project: nunit-gui
Source File: MainForm.cs
protected override void OnDragDrop(DragEventArgs drgevent)
        {
            base.OnDragDrop(drgevent);

            string[] files = (string[])drgevent.Data.GetData(DataFormats.FileDrop);
            if (files != null)
                DragDropFiles?.Invoke(files);
        }

21. Example

Project: poderosa
Source File: MainWindow.cs
protected override void OnDragDrop(DragEventArgs args) {
            base.OnDragDrop(args);
            try {
                WindowManagerPlugin.Instance.BypassDragDrop(this, args);
            }
            catch (Exception ex) {
                RuntimeUtil.ReportException(ex);
            }
        }

22. Example

Project: poderosa
Source File: ToolBar.cs
protected override void OnDragDrop(DragEventArgs drgevent) {
            base.OnDragDrop(drgevent);
            try {
                WindowManagerPlugin.Instance.BypassDragDrop(this.ParentForm, drgevent);
            }
            catch (Exception ex) {
                RuntimeUtil.ReportException(ex);
            }
        }

23. Example

Project: JabberNet-2010
Source File: RosterTree.cs
protected override void OnDragDrop(DragEventArgs drgevent)
        {
            base.OnDragDrop(drgevent);

            GroupNode group = this.GetDropGroup(drgevent);

            if (group == null)
                return;

            ItemNode item = drgevent.Data.GetData(typeof(ItemNode)) as ItemNode;
            GroupNode parent = (GroupNode)item.Parent;
            Item i = (Item)item.Item.CloneNode(true, m_client.Document);

            String parentGroupName = this.Client.SupportNestedGroups ? parent.FullPath : parent.GroupName;
            i.RemoveGroup(parentGroupName);

            String groupName = this.Client.SupportNestedGroups ? group.FullPath : group.GroupName;

            if (groupName != this.Unfiled)
                i.AddGroup(groupName);

            m_roster.Modify(i);
        }

24. Example

Project: winforms
Source File: PropertyGrid.cs
protected override void OnDragDrop(DragEventArgs e)
		{
			base.OnDragDrop(e);

			if (this.mainEditor != null)
			{
				Point localPoint = this.PointToClient(new Point(e.X, e.Y));
				DragEventArgs subEvent = new DragEventArgs(
					e.Data, 
					e.KeyState, 
					localPoint.X - this.ClientRectangle.X,
					localPoint.Y - this.ClientRectangle.Y - this.AutoScrollPosition.Y,
					e.AllowedEffect,
					e.Effect);
				this.mainEditor.OnDragDrop(subEvent);
				e.Effect = subEvent.Effect;
			}
		}

25. Example

Project: Outliner-3.0
Source File: TreeView.cs
protected override void OnDragDrop(DragEventArgs drgevent)
   {
      if (drgevent == null)
         throw new ArgumentNullException("drgevent");

      Point location = this.PointToClient(new Point(drgevent.X, drgevent.Y));
      TreeNode tn = this.GetNodeAt(location);
      IDragDropHandler dragDropHandler = this.getDragDropHandler(tn, location);

      if (prevDragTarget != null)
      {
         prevDragTarget.RemoveStateFlag(TreeNodeStates.DropTarget);
         prevDragTarget = null;
      }

      if (dragDropHandler != null)
      {
         dragDropHandler.HandleDrop(drgevent.Data);
      }
      
      base.OnDragDrop(drgevent);
   }

26. Example

Project: StackBuilder
Source File: FileSelect.cs
protected override void OnDragDrop(DragEventArgs e)
        {
            if (e.Data.GetDataPresent(DataFormats.FileDrop))
                AddFiles(
                (string[])e.Data.GetData(DataFormats.FileDrop));
            base.OnDragDrop(e);
        }

27. Example

Project: TaskScheduler
Source File: ReorderableListView.cs
protected override void OnDragDrop(DragEventArgs e)
		{
			base.OnDragDrop(e);
			if (AllowRowReorde/n ..... /n //View Source file for more details /n }

28. Example

Project: Toxy
Source File: MyListView.cs
protected override void OnDragDrop(DragEventArgs drgevent)
        {
            base.OnDragDrop(drgevent);

            ListViewItem lvi = drgevent.Data.GetData(typeof(ListViewItem)) as ListViewItem;

            if (lvi != null && lvi.ListView == this && lvi != dragOverItem)
            {
                int oldIndex = lvi.Index;
                int newIndex;

                if (dragOverItem != null)
                {
                    newIndex = dragOverItem.Index;

                    if (newIndex > oldIndex)
                    {
                        newIndex--;
                    }
                }
                else
                {
                    newIndex = Items.Count - 1;
                }

                Items.RemoveAt(oldIndex);
                Items.Insert(newIndex, lvi);

                OnItemMoved(oldIndex, newIndex);
            }

            lineIndex = lastLineIndex = -1;
            Invalidate();
        }

29. Example

Project: MvvmFx
Source File: BoundTreeView.cs
protected override void OnDragDrop(DragEventArgs e)
        {
            if (e.Data.GetDataPresent(/n ..... /n //View Source file for more details /n }

30. Example

Project: MvvmFx
Source File: BoundTreeView.cs
protected override void OnDragDrop(DragEventArgs e)
        {
            if (e.Data.GetDataPresent(/n ..... /n //View Source file for more details /n }

31. Example

Project: MvvmFx
Source File: BoundTreeView.cs
protected override void OnDragDrop(DragEventArgs e)
        {
            if (e.Data.GetDataPresent(/n ..... /n //View Source file for more details /n }

32. Example

Project: MvvmFx
Source File: BoundTreeView.cs
protected override void OnDragDrop(DragEventArgs e)
        {
            if (e.Data.GetDataPresent(/n ..... /n //View Source file for more details /n }

33. Example

Project: poderosa
Source File: TabBar.cs
protected override void OnDragDrop(DragEventArgs drgevent) {
            base.OnDragDrop(drgevent);
            if (!_dragAndDrop.OwnsDropPoint(this)) {
                _parentTable.ByPassDragDrop(drgevent);
                return; //Drop?????????????
            }

            try {
                DragAndDropSupport.DropResult r;
                using (TabBarUpdateState state = new TabBarUpdateState("drop")) {
                    r = _dragAndDrop.Drop(state);
                }
                if (r == DragAndDropSupport.DropResult.Ignored) {
                    Invalidate();
                }
            }
            catch (Exception ex) {
                Debug.WriteLine(ex.Message);
                Debug.WriteLine(ex.StackTrace);
            }
        }

34. Example

Project: ShareX
Source File: MyListView.cs
protected override void OnDragDrop(DragEventArgs drgevent)
        {
            base.OnDragDrop(drgevent);

            ListViewItem lvi = drgevent.Data.GetData(typeof(ListViewItem)) as ListViewItem;

            if (lvi != null && lvi.ListView == this && lvi != dragOverItem)
            {
                int oldIndex = lvi.Index;
                int newIndex;

                if (dragOverItem != null)
                {
                    newIndex = dragOverItem.Index;

                    if (newIndex > oldIndex)
                    {
                        newIndex--;
                    }
                }
                else
                {
                    newIndex = Items.Count - 1;
                }

                Items.RemoveAt(oldIndex);
                Items.Insert(newIndex, lvi);

                OnItemMoved(oldIndex, newIndex);
            }

            lineIndex = lastLineIndex = -1;
            Invalidate();
        }

35. Example

Project: ShareX
Source File: MyListView.cs
protected override void OnDragDrop(DragEventArgs drgevent)
        {
            base.OnDragDrop(drgevent);

            ListViewItem lvi = drgevent.Data.GetData(typeof(ListViewItem)) as ListViewItem;

            if (lvi != null && lvi.ListView == this && lvi != dragOverItem)
            {
                int oldIndex = lvi.Index;
                int newIndex;

                if (dragOverItem != null)
                {
                    newIndex = dragOverItem.Index;

                    if (newIndex > oldIndex)
                    {
                        newIndex--;
                    }
                }
                else
                {
                    newIndex = Items.Count - 1;
                }

                Items.RemoveAt(oldIndex);
                Items.Insert(newIndex, lvi);

                OnItemMoved(oldIndex, newIndex);
            }

            lineIndex = lastLineIndex = -1;
            Invalidate();
        }

36. Example

Project: ClearCanvas
Source File: BindingTreeView.cs
protected override void OnDragDrop(DragEventArgs e)
        {
            // is there a current drop-target node?
            if (_dropTargetNode != null)
            {
                try
                {
					object dragDropData = GetDragDropData(e);
					
					// ask the node to accept the drop
					DragDropKind result = _dropTargetNode.AcceptDrop(dragDropData, GetDragDropKind(e.Effect), _dropPosition);

                    // be sure to set the resulting effect in the event args, so that it gets communicated
                    // back to the initiator of the drag drop operation
                    e.Effect = GetDragDropEffect(result);

					// Fire the item dropped event
					if (e.Effect != DragDropEffects.None)
					{
						ItemDroppedEventArgs args = new ItemDroppedEventArgs(dragDropData, result);
						EventsHelper.Fire(_itemDropped, this, args);
					}
				}
                catch (Exception ex)
                {
                    Platform.Log(LogLevel.Error, ex);
                }

                // remove highlighting from drop target node
                HighlightNode(_dropTargetNode, false);
            	SetInsertMark(_dropTargetNode, DragDropPosition.Default);
            }

            // clear the drop target node
            _dropTargetNode = null;
            _dropEffect = DragDropEffects.None;
        	_dropPosition = DragDropPosition.Default;

            base.OnDragDrop(e);
        }

37. Example

Project: ClearCanvas
Source File: ListBoxWithDragSupport.cs
protected override void OnDragDrop(DragEventArgs drgevent)
		{
			if (drgevent.Data.GetDataPresent(typeof(int)))
			{
				int index = (int)drgevent.Data.GetData(typeof(int));
				int newIndex = this.IndexFromPoint(this.PointToClient(new Point(drgevent.X, drgevent.Y)));

				// Notify subscriber that an item is dropped.
				EventsHelper.Fire(_itemDropped, this, new ListBoxItemDroppedEventArgs(index, newIndex));

				// Set selection on the new item.
				this.SetSelected(newIndex, true);
			}

			base.OnDragDrop(drgevent);
		}

38. Example

Project: fomm
Source File: ReorderableItemListView.cs
protected override void OnDragDrop(DragEventArgs drgevent)
    {
      _PauseItemDrag = false;
     /n ..... /n //View Source file for more details /n }

39. Example

Project: BSA_Browser
Source File: ReorderableItemListView.cs
protected override void OnDragDrop(DragEventArgs drgevent)
        {
            _PauseItemDrag = fa/n ..... /n //View Source file for more details /n }

40. Example

Project: P8Coder
Source File: FastColoredTextBox.cs
protected override void OnDragDrop(DragEventArgs e)
        {
            if (ReadOnly || !AllowDrop)
            {
                IsDragDrop = false;
                return;
            }

            if (e.Data.GetDataPresent(DataFormats.Text))
            {
                if (ParentForm != null)
                    ParentForm.Activate();
                Focus();
                Point p = PointToClient(new Point(e.X, e.Y));
                var text = e.Data.GetData(DataFormats.Text).ToString();
                var place = PointToPlace(p);
                DoDragDrop(place, text);
                IsDragDrop = false;
            }
            base.OnDragDrop(e);
        }

41. Example

Project: BaijiGenerator.Net
Source File: FastColoredTextBox.cs
protected override void OnDragDrop(DragEventArgs e)
        {
            if (ReadOnly || !AllowDrop)
            {
                IsDragDrop = false;
                return;
            }

            if (e.Data.GetDataPresent(DataFormats.Text))
            {
                if (ParentForm != null)
                    ParentForm.Activate();
                Focus();
                Point p = PointToClient(new Point(e.X, e.Y));
                var text = e.Data.GetData(DataFormats.Text).ToString();
                var place = PointToPlace(p);
                DoDragDrop(place, text);
                IsDragDrop = false;
            }
            base.OnDragDrop(e);
        }

42. Example

Project: dash-core
Source File: FastColoredTextBox.cs
protected override void OnDragDrop(DragEventArgs e)
        {
            if (ReadOnly || !AllowDrop)
            {
                IsDragDrop = false;
                return;
            }

            if (e.Data.GetDataPresent(DataFormats.Text))
            {
                if (ParentForm != null)
                    ParentForm.Activate();
                Focus();
                Point p = PointToClient(new Point(e.X, e.Y));
                var text = e.Data.GetData(DataFormats.Text).ToString();
                var place = PointToPlace(p);
                DoDragDrop(place, text);
                IsDragDrop = false;
            }
            base.OnDragDrop(e);
        }

43. Example

Project: poderosa
Source File: TerminalControl.cs
protected override void OnDragDrop(DragEventArgs args) {
            base.OnDragDrop(args);
            try {
                IWinFormsService wfs = TerminalEmulatorPlugin.Instance.GetWinFormsService();
                IPoderosaDocument document = (IPoderosaDocument)wfs.GetDraggingObject(args.Data, typeof(IPoderosaDocument));
                if (document != null) {
                    IPoderosaView view = (IPoderosaView)this.GetAdapter(typeof(IPoderosaView));
                    TerminalEmulatorPlugin.Instance.GetSessionManager().AttachDocumentAndView(document, view);
                    TerminalEmulatorPlugin.Instance.GetSessionManager().ActivateDocument(document, ActivateReason.DragDrop);
                }
                else
                    wfs.BypassDragDrop(this, args);
            }
            catch (Exception ex) {
                RuntimeUtil.ReportException(ex);
            }
        }

44. Example

Project: ynoteclassic
Source File: FastColoredTextBox.cs
protected override void OnDragDrop(DragEventArgs e)
		{
			if (ReadOnly || !AllowDrop)
			{
				IsDragDrop = false;
				return;
			}

			if (e.Data.GetDataPresent(DataFormats.Text))
			{
				if (ParentForm != null)
					ParentForm.Activate();
				Focus();
				Point p = PointToClient(new Point(e.X, e.Y));
				var text = e.Data.GetData(DataFormats.Text).ToString();
				var place = PointToPlace(p);
				DoDragDrop(place, text);
				IsDragDrop = false;
			}
			base.OnDragDrop(e);
		}

45. Example

Project: winauth
Source File: AuthenticatorListBox.cs
protected override void OnDragDrop(DragEventArgs e)
		{
			AuthenticatorListitem item = e.Data.GetData(typeof(AuthenticatorListitem)) as AuthenticatorListitem;
			if (item != null)
			{
				// stop paiting as we reorder to reduce flicker
				WinAPI.SendMessage(this.Handle, WinAPI.WM_SETREDRAW, 0, IntPtr.Zero);
				try
				{
					// get the new index
					Point point = this.PointToClient(new Point(e.X, e.Y));
					int index = this.IndexFromPoint(point);
					if (index < 0)
					{
						index = this.Items.Count - 1;
					}
					// move the item
					this.Items.Remove(item);
					this.Items.Insert(index, item);

					// set the correct indexes of our items
					for (int i = 0; i < this.Items.Count; i++)
					{
						(this.Items[i] as AuthenticatorListitem).Index = i;
					}

					// fire the reordered event
					Reordered(this, new AuthenticatorListReorderedEventArgs());

					// clear state
					item.Dragging = false;
					_draggedItem = null;
					if (_draggedBitmap != null)
					{
						_draggedBitmap.Dispose();
						_draggedBitmap = null;
					}

					if (_lastDragTopIndex != null)
					{
						this.TopIndex = _lastDragTopIndex.Value;
					}
				}
				finally
				{
					// resume painting
					WinAPI.SendMessage(this.Handle, WinAPI.WM_SETREDRAW, 1, IntPtr.Zero);
				}
				this.Refresh();
			}
			else
			{
				base.OnDragDrop(e);
			}
		}

46. Example

Project: WGestures
Source File: ReorderableListView.cs
protected override void OnDragDrop(DragEventArgs drgevent)
        {
            if (this.IsRowDragI/n ..... /n //View Source file for more details /n }

47. Example

Project: samschanneledit
Source File: ListViewDragAndDrop.cs
protected override void OnDragDrop(DragEventArgs drgevent)
    {
      base.OnDragDrop(drgevent);

 /n ..... /n //View Source file for more details /n }

48. Example

Project: just-gestures
Source File: DragAndDropListView.cs
protected override void OnDragDrop(DragEventArgs drgevent)
		{
			if(!m_allowReorder)
			{
				base./n ..... /n //View Source file for more details /n }