416 references to DragDropEffects
System.Windows.Forms (62)
System\Windows\Forms\Control.cs (16)
4781
/// <inheritdoc cref="DoDragDropAsJson{T}(T,
DragDropEffects
, Bitmap?, Point, bool)"/>
4782
public
DragDropEffects
DoDragDropAsJson<T>(T data,
DragDropEffects
allowedEffects) =>
4793
/// <returns>A value from the <see cref="
DragDropEffects
"/> enumeration that represents the final effect that was performed during the drag-and-drop operation.</returns>
4797
/// then pass the <paramref name="data"/> to <see cref="DoDragDrop(object,
DragDropEffects
)"/>.
4802
/// the same as <see cref="DoDragDrop(object,
DragDropEffects
)"/>.
4805
public
DragDropEffects
DoDragDropAsJson<T>(
4807
DragDropEffects
allowedEffects,
4831
public
DragDropEffects
DoDragDrop(object data,
DragDropEffects
allowedEffects) =>
4848
/// A value from the <see cref="
DragDropEffects
"/> enumeration that represents the final effect that was performed
4853
/// Because <see cref="DoDragDrop(object,
DragDropEffects
, Bitmap, Point, bool)"/> always performs the
4860
public
DragDropEffects
DoDragDrop(
4862
DragDropEffects
allowedEffects,
4878
return
DragDropEffects
.None;
4889
return (
DragDropEffects
)finalEffect;
System\Windows\Forms\Controls\RichTextBox\RichTextBox.OleCallback.cs (16)
20
private
DragDropEffects
_lastEffect;
125
_lastEffect =
DragDropEffects
.None;
133
DragDropEffects
.All,
139
DragDropEffects
.All,
159
e.Effect = keyState.HasFlag(MODIFIERKEYS_FLAGS.MK_CONTROL) ?
DragDropEffects
.Copy :
DragDropEffects
.Move;
185
return e.Effect ==
DragDropEffects
.None ? HRESULT.E_FAIL : HRESULT.S_OK;
214
?
DragDropEffects
.All |
DragDropEffects
.None
215
:
DragDropEffects
.None;
238
DragDropEffects
.All,
244
DragDropEffects
.All,
251
if (_lastEffect !=
DragDropEffects
.None)
254
?
DragDropEffects
.Copy
255
:
DragDropEffects
.Move;
290
=> e.Effect !=
DragDropEffects
.None && e.DropImageType > DropImageType.Invalid && _owner.IsHandleCreated;
System\Windows\Forms\Controls\ToolStrips\ToolStripDropTargetManager.cs (1)
214
Effect =
DragDropEffects
.None,
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (9)
2061
DoDragDrop(item,
DragDropEffects
.Move);
2129
public
DragDropEffects
DoDragDrop(object data,
DragDropEffects
allowedEffects)
2148
/// A value from the <see cref="
DragDropEffects
"/> enumeration that represents the final effect that was performed
2153
/// Because <see cref="DoDragDrop(object,
DragDropEffects
, Bitmap, Point, bool)"/> always performs the
2160
public unsafe
DragDropEffects
DoDragDrop(object data,
DragDropEffects
allowedEffects, Bitmap? dragImage, Point cursorOffset, bool useDefaultDragImage)
2197
return
DragDropEffects
.None;
2208
return (
DragDropEffects
)finalEffect;
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitStackDragDropHandler.cs (3)
25
e.Effect =
DragDropEffects
.Move;
50
e.Effect =
DragDropEffects
.Move;
56
e.Effect =
DragDropEffects
.None;
System\Windows\Forms\GiveFeedbackEventArgs.cs (3)
18
public GiveFeedbackEventArgs(
DragDropEffects
effect, bool useDefaultCursors)
26
public GiveFeedbackEventArgs(
DragDropEffects
effect, bool useDefaultCursors, Bitmap? dragImage, Point cursorOffset, bool useDefaultDragImage)
38
public
DragDropEffects
Effect { get; }
System\Windows\Forms\OLE\DragEventArgs.cs (6)
23
DragDropEffects
allowedEffect,
24
DragDropEffects
effect)
37
DragDropEffects
allowedEffect,
38
DragDropEffects
effect,
77
public
DragDropEffects
AllowedEffect { get; }
82
public
DragDropEffects
Effect { get; set; }
System\Windows\Forms\OLE\DropSource.cs (3)
27
_lastGiveFeedbackEventArgs = new(
DragDropEffects
.None, useDefaultCursors: false, dragImage, cursorOffset, useDefaultDragImage);
61
? new((
DragDropEffects
)dwEffect, useDefaultCursors: true)
63
(
DragDropEffects
)dwEffect,
System\Windows\Forms\OLE\DropTarget.cs (5)
16
private
DragDropEffects
_lastEffect =
DragDropEffects
.None;
90
? new DragEventArgs(data, (int)grfKeyState, pt.x, pt.y, (
DragDropEffects
)pdwEffect, _lastEffect)
96
(
DragDropEffects
)pdwEffect,
198
_lastEffect =
DragDropEffects
.None;
System.Windows.Forms.Design (144)
System\Windows\Forms\Design\Behavior\Behavior.cs (3)
328
else if (e.Effect !=
DragDropEffects
.None)
330
e.Effect = (Control.ModifierKeys == Keys.Control) ?
DragDropEffects
.Copy :
DragDropEffects
.Move;
System\Windows\Forms\Design\Behavior\BehaviorService.cs (7)
185
internal
DragDropEffects
DoDragDrop(DropSourceBehavior dropSourceBehavior)
191
DragDropEffects
res =
DragDropEffects
.None;
228
res =
DragDropEffects
.None;
644
if (g is ControlBodyGlyph && e.Effect ==
DragDropEffects
.None)
823
e.Effect =
DragDropEffects
.None;
834
e.Effect =
DragDropEffects
.None;
System\Windows\Forms\Design\Behavior\DropSourceBehavior.cs (14)
34
private readonly
DragDropEffects
_allowedEffects; // initial allowed effects for the drag operation
35
private
DragDropEffects
_lastEffect; // the last effect we saw (used for determining a valid drop)
108
_allowedEffects =
DragDropEffects
.Copy |
DragDropEffects
.None |
DragDropEffects
.Move;
112
_lastEffect =
DragDropEffects
.None;
123
internal
DragDropEffects
AllowedEffects
232
if (_lastEffect ==
DragDropEffects
.Copy || (_srcHost != _destHost && _destHost is not null))
337
bool performCopy = (_lastEffect ==
DragDropEffects
.Copy);
601
if (_data.Target is null || e.Effect ==
DragDropEffects
.None)
627
if (_data.Target.Equals(_data.Source) && _lastEffect !=
DragDropEffects
.Copy)
724
if (ShowHideDragControls(_lastEffect ==
DragDropEffects
.Copy) && !createNewDragAssistance)
735
_dragAssistanceManager = new DragAssistanceManager(_serviceProviderTarget, _graphicsTarget, _dragObjects, null, _lastEffect ==
DragDropEffects
.Copy);
1089
if (e.Action == DragAction.Cancel || _lastEffect ==
DragDropEffects
.None)
System\Windows\Forms\Design\Behavior\ToolStripPanelSelectionBehavior.cs (5)
252
ReParentControls(components, e.Effect ==
DragDropEffects
.Copy);
309
private static
DragDropEffects
GetEffect(IDataObject data)
312
?
DragDropEffects
.Copy
313
:
DragDropEffects
.Move
314
:
DragDropEffects
.None;
System\Windows\Forms\Design\ComponentTray.cs (8)
1098
de.Effect =
DragDropEffects
.Copy;
1129
Debug.Assert((de.AllowedEffect & (
DragDropEffects
.Move |
DragDropEffects
.Copy)) != 0, "DragDropEffect.Move | .Copy isn't allowed?");
1130
if ((de.AllowedEffect &
DragDropEffects
.Move) != 0)
1132
de.Effect =
DragDropEffects
.Move;
1136
de.Effect =
DragDropEffects
.Copy;
1163
Debug.Assert((de.AllowedEffect &
DragDropEffects
.Copy) != 0, "DragDropEffect.Move isn't allowed?");
1164
de.Effect =
DragDropEffects
.Copy;
System\Windows\Forms\Design\ControlDesigner.TransparentBehavior.cs (1)
73
e.Effect =
DragDropEffects
.None;
System\Windows\Forms\Design\FlowLayoutPanelDesigner .cs (1)
564
bool performCopy = de.Effect ==
DragDropEffects
.Copy;
System\Windows\Forms\Design\OleDragDropHandler.cs (56)
32
private
DragDropEffects
_localDragEffect;
321
DragDropEffects
oldEffect,
365
if ((oldEffect &
DragDropEffects
.Move) == 0 ||
387
if ((oldEffect &
DragDropEffects
.Move) == 0 ||
467
DragDropEffects
allowedEffects =
DragDropEffects
.Copy |
DragDropEffects
.None |
DragDropEffects
.Move;
480
allowedEffects &= ~
DragDropEffects
.Move;
481
allowedEffects |= (
DragDropEffects
)AllowLocalMoveOnly;
520
DragDropEffects
effect =
DragDropEffects
.None;
548
bool isMove = (effect &
DragDropEffects
.Move) != 0 || ((int)effect & AllowLocalMoveOnly) != 0;
568
if (!_localDragOffset.IsEmpty && effect !=
DragDropEffects
.None)
600
de.Effect =
DragDropEffects
.None;
606
de.AllowedEffect ==
DragDropEffects
.None ||
609
de.Effect =
DragDropEffects
.None;
618
bool moveAllowed = (de.AllowedEffect &
DragDropEffects
.Move) !=
DragDropEffects
.None || localMoveOnly;
619
bool copyAllowed = (de.AllowedEffect &
DragDropEffects
.Copy) !=
DragDropEffects
.None;
621
if ((de.Effect &
DragDropEffects
.Move) != 0 && !moveAllowed)
624
de.Effect =
DragDropEffects
.Copy;
628
if ((de.Effect &
DragDropEffects
.Copy) != 0 && !copyAllowed)
632
de.Effect =
DragDropEffects
.None;
636
if (localMoveOnly && (de.Effect &
DragDropEffects
.Move) != 0)
638
de.Effect |= (
DragDropEffects
)AllowLocalMoveOnly |
DragDropEffects
.Move;
640
else if ((de.Effect &
DragDropEffects
.Copy) != 0)
642
de.Effect =
DragDropEffects
.Copy;
664
if (_dragOk || (_localDragInside && de.Effect ==
DragDropEffects
.Copy))
684
if (de.Effect ==
DragDropEffects
.Copy || newContainer)
688
cdo.Deserialize(_serviceProvider, (de.Effect &
DragDropEffects
.Copy) == 0);
779
de.Effect =
DragDropEffects
.None;
870
if (!Dragging && CanDropDataObject(de.Data) && de.AllowedEffect !=
DragDropEffects
.None)
880
if ((de.KeyState & (int)MODIFIERKEYS_FLAGS.MK_CONTROL) != 0 && (de.AllowedEffect &
DragDropEffects
.Copy) != 0)
882
de.Effect =
DragDropEffects
.Copy;
884
else if ((de.AllowedEffect &
DragDropEffects
.Move) != 0)
886
de.Effect =
DragDropEffects
.Move;
890
de.Effect =
DragDropEffects
.None;
894
else if (Dragging && de.AllowedEffect !=
DragDropEffects
.None)
898
&& (de.AllowedEffect &
DragDropEffects
.Copy) != 0
901
de.Effect =
DragDropEffects
.Copy;
908
de.Effect |= (
DragDropEffects
)AllowLocalMoveOnly;
911
if ((de.AllowedEffect &
DragDropEffects
.Move) != 0)
913
de.Effect |=
DragDropEffects
.Move;
918
de.Effect =
DragDropEffects
.None;
950
de.Effect =
DragDropEffects
.None;
955
&& (de.AllowedEffect &
DragDropEffects
.Copy) != 0
961
bool move = (de.AllowedEffect &
DragDropEffects
.Move) != 0 || localMoveOnly;
988
de.Effect =
DragDropEffects
.Copy;
992
de.Effect =
DragDropEffects
.Move;
996
de.Effect =
DragDropEffects
.None;
1001
de.Effect |= (
DragDropEffects
)AllowLocalMoveOnly;
1012
e.UseDefaultCursors = ((!_localDragInside && !_forceDrawFrames) || ((e.Effect & (
DragDropEffects
.Copy)) != 0)) || e.Effect ==
DragDropEffects
.None;
System\Windows\Forms\Design\ParentControlDesigner.cs (19)
1459
de.Effect = (Control.ModifierKeys == Keys.Control) ?
DragDropEffects
.Copy :
DragDropEffects
.Move;
1471
de.Effect =
DragDropEffects
.None;
1499
de.Effect =
DragDropEffects
.None;
1528
de.Effect =
DragDropEffects
.None;
1557
de.Effect =
DragDropEffects
.None;
1565
de.Effect =
DragDropEffects
.None;
1615
Debug.Assert((de.AllowedEffect & (
DragDropEffects
.Move |
DragDropEffects
.Copy)) != 0, "DragDropEffect.Move | .Copy isn't allowed?");
1616
if ((de.AllowedEffect &
DragDropEffects
.Move) != 0)
1618
de.Effect =
DragDropEffects
.Move;
1622
de.Effect =
DragDropEffects
.Copy;
1628
de.Effect =
DragDropEffects
.None;
1660
de.Effect = (Control.ModifierKeys == Keys.Control) ?
DragDropEffects
.Copy :
DragDropEffects
.Move;
1671
de.Effect =
DragDropEffects
.None;
1681
de.Effect =
DragDropEffects
.None;
1688
Debug.Assert((de.AllowedEffect &
DragDropEffects
.Copy) != 0, "DragDropEffect.Move isn't allowed?");
1689
de.Effect =
DragDropEffects
.Copy;
System\Windows\Forms\Design\SplitContainerDesigner.cs (1)
155
protected override void OnDragEnter(DragEventArgs de) => de.Effect =
DragDropEffects
.None;
System\Windows\Forms\Design\SplitterPanelDesigner.cs (3)
54
de.Effect =
DragDropEffects
.None;
65
de.Effect =
DragDropEffects
.None;
86
de.Effect =
DragDropEffects
.None;
System\Windows\Forms\Design\TabControlDesigner.cs (1)
576
de.Effect =
DragDropEffects
.None;
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (2)
495
bool localCopy = ((de is not null) && (de.Effect ==
DragDropEffects
.Copy) && localReposition);
1384
de.Effect =
DragDropEffects
.None;
System\Windows\Forms\Design\ToolStripDesigner.cs (5)
1887
bool copy = (de.Effect ==
DragDropEffects
.Copy);
1945
if (de.Effect ==
DragDropEffects
.Move || copy)
2335
?
DragDropEffects
.None
2336
: (Control.ModifierKeys == Keys.Control) ?
DragDropEffects
.Copy :
DragDropEffects
.Move;
System\Windows\Forms\Design\ToolStripItemBehavior.cs (9)
619
DropSource.DoDragDrop(data,
DragDropEffects
.All);
660
bool copy = (e.Effect ==
DragDropEffects
.Copy);
725
if (e.Effect ==
DragDropEffects
.Move || copy)
853
e.Effect =
DragDropEffects
.Move;
857
e.Effect =
DragDropEffects
.None;
862
e.Effect =
DragDropEffects
.None;
886
e.Effect = (Control.ModifierKeys == Keys.Control) ?
DragDropEffects
.Copy :
DragDropEffects
.Move;
890
e.Effect =
DragDropEffects
.None;
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (6)
2651
e.Effect = (Control.ModifierKeys == Keys.Control) ?
DragDropEffects
.Copy :
DragDropEffects
.Move;
2666
e.Effect = (Control.ModifierKeys == Keys.Control) ?
DragDropEffects
.Copy :
DragDropEffects
.Move;
2696
bool copy = (e.Effect ==
DragDropEffects
.Copy);
2753
if (e.Effect ==
DragDropEffects
.Move || copy)
System\Windows\Forms\Design\TreeNodeCollectionEditor.cs (3)
510
DoDragDrop(item,
DragDropEffects
.Move);
517
e.Effect =
DragDropEffects
.Move;
521
e.Effect =
DragDropEffects
.None;
System.Windows.Forms.Design.Tests (36)
System\Windows\Forms\Design\ControlDesigner.TransparentBehaviorTests.cs (12)
48
DragEventArgs dragEventArgs = new(null, 0, 0, 0,
DragDropEffects
.Copy,
DragDropEffects
.None);
59
DragEventArgs dragEventArgs = new(null, 0, 0, 0,
DragDropEffects
.Copy,
DragDropEffects
.None);
71
_behavior.OnDragEnter(null, new DragEventArgs(null, 0, 0, 0,
DragDropEffects
.Copy,
DragDropEffects
.None));
82
_behavior.OnDragEnter(null, new DragEventArgs(null, 0, 0, 0,
DragDropEffects
.Copy,
DragDropEffects
.None));
83
DragEventArgs dragEventArgs = new(null, 0, int.MaxValue, int.MaxValue,
DragDropEffects
.Copy,
DragDropEffects
.Copy);
87
dragEventArgs.Effect.Should().Be(
DragDropEffects
.None);
93
GiveFeedbackEventArgs feedbackEventArgs = new(
DragDropEffects
.Copy, true);
System\Windows\Forms\Design\OleDragDropHandlerTests.cs (18)
105
DragEventArgs dragEventArgs = new(new DataObject(), 0, 0, 0,
DragDropEffects
.None,
DragDropEffects
.None);
109
dragEventArgs.Effect.Should().Be(
DragDropEffects
.None);
115
DragEventArgs dragEventArgs = new(new DataObject(), 0, 0, 0,
DragDropEffects
.None,
DragDropEffects
.None);
119
dragEventArgs.Effect.Should().Be(
DragDropEffects
.None);
125
DragEventArgs dragEventArgs = new(new DataObject(), 0, 0, 0,
DragDropEffects
.Move,
DragDropEffects
.None);
130
dragEventArgs.Effect.Should().Be(
DragDropEffects
.None);
144
DragEventArgs dragEventArgs = new(new DataObject(), 0, 0, 0,
DragDropEffects
.None,
DragDropEffects
.None);
148
dragEventArgs.Effect.Should().Be(
DragDropEffects
.None);
154
DragEventArgs dragEventArgs = new(new DataObject(), 0, 0, 0,
DragDropEffects
.None,
DragDropEffects
.None);
158
dragEventArgs.Effect.Should().Be(
DragDropEffects
.None);
164
GiveFeedbackEventArgs giveFeedbackEventArgs = new(
DragDropEffects
.Move, false);
181
DragEventArgs dragEventArgs = new(null, 0, 0, 0,
DragDropEffects
.None,
DragDropEffects
.None);
System\Windows\Forms\Design\SelectionUIHandlerTests.cs (6)
178
DragEventArgs dragEventArgs = new(new DataObject(), 0, 0, 0,
DragDropEffects
.None,
DragDropEffects
.None);
187
DragEventArgs dragEventArgs = new(new DataObject(), 0, 0, 0,
DragDropEffects
.None,
DragDropEffects
.None);
196
DragEventArgs dragEventArgs = new(new DataObject(), 0, 0, 0,
DragDropEffects
.None,
DragDropEffects
.None);
System.Windows.Forms.Tests (105)
System\Windows\Forms\ControlTests.Handlers.cs (3)
1304
yield return new object[] { new DragEventArgs(null, 1, 2, 3,
DragDropEffects
.Copy,
DragDropEffects
.Move) };
2059
yield return new object[] { new GiveFeedbackEventArgs(
DragDropEffects
.None, true) };
System\Windows\Forms\ControlTests.Methods.ClipboardTests.cs (6)
18
foreach (
DragDropEffects
allowedEffects in Enum.GetValues(typeof(
DragDropEffects
)))
31
public void Control_DoDragDrop_Invoke_ReturnsNone(object data,
DragDropEffects
allowedEffects)
34
Assert.Equal(
DragDropEffects
.None, control.DoDragDrop(data, allowedEffects));
41
public void Control_DoDragDrop_InvokeWithHandle_ReturnsNone(object data,
DragDropEffects
allowedEffects)
52
Assert.Equal(
DragDropEffects
.None, control.DoDragDrop(data, allowedEffects));
System\Windows\Forms\ControlTests.Methods.cs (2)
1819
Action dragDrop = () => control.DoDragDrop(null,
DragDropEffects
.All);
1827
Action dragDrop = () => control.DoDragDropAsJson<string>(null,
DragDropEffects
.Copy);
System\Windows\Forms\DragDropHelperTests.cs (19)
31
yield return new object[] { new DataObject(), new GiveFeedbackEventArgs(
DragDropEffects
.All, false, new Bitmap(1, 1), new Point(0, 0), false) };
32
yield return new object[] { new DataObject(), new GiveFeedbackEventArgs(
DragDropEffects
.All, false, null, new Point(0, 0), false) };
33
yield return new object[] { new DataObject(), new GiveFeedbackEventArgs(
DragDropEffects
.All, false, new Bitmap(1, 1), new Point(0, 0), true) };
38
yield return new object[] { new DragEventArgs(new DataObject(), 1, 2, 3,
DragDropEffects
.Copy,
DragDropEffects
.Copy, DropImageType.Invalid, string.Empty, string.Empty) };
39
yield return new object[] { new DragEventArgs(new DataObject(), 1, 2, 3,
DragDropEffects
.Copy,
DragDropEffects
.Copy, DropImageType.None, string.Empty, string.Empty) };
40
yield return new object[] { new DragEventArgs(new DataObject(), 1, 2, 3,
DragDropEffects
.Copy,
DragDropEffects
.Copy, DropImageType.Copy, "Copy to %1", "Documents") };
41
yield return new object[] { new DragEventArgs(new DataObject(), 1, 2, 3,
DragDropEffects
.Copy,
DragDropEffects
.Copy, DropImageType.Move, "Move to %1", "Documents") };
42
yield return new object[] { new DragEventArgs(new DataObject(), 1, 2, 3,
DragDropEffects
.Copy,
DragDropEffects
.Copy, DropImageType.Link, "Create link in %1", "Documents") };
43
yield return new object[] { new DragEventArgs(new DataObject(), 1, 2, 3,
DragDropEffects
.Copy,
DragDropEffects
.Copy, DropImageType.Label, "Update metadata in %1", "Document") };
44
yield return new object[] { new DragEventArgs(new DataObject(), 1, 2, 3,
DragDropEffects
.Copy,
DragDropEffects
.Copy, DropImageType.Warning, "A problem has been encountered", string.Empty) };
45
yield return new object[] { new DragEventArgs(new DataObject(), 1, 2, 3,
DragDropEffects
.Copy,
DragDropEffects
.Copy, DropImageType.NoImage, "Copy to %1", "Documents") };
System\Windows\Forms\DragEventArgsTests.cs (23)
13
yield return new object[] { null, -1, -2, -3,
DragDropEffects
.None - 1,
DragDropEffects
.None - 1 };
14
yield return new object[] { new CustomDataObject(), 1, 2, 3,
DragDropEffects
.Copy,
DragDropEffects
.Move };
19
yield return new object[] { null, -1, -2, -3,
DragDropEffects
.None - 1,
DragDropEffects
.None - 1, (DropImageType.Invalid - 1), null, null };
20
yield return new object[] { new CustomDataObject(), 1, 2, 3,
DragDropEffects
.Copy,
DragDropEffects
.Move, DropImageType.Copy, "Move to %1", "Documents" };
25
public void Ctor_IDataObject_Int_Int_Int_DragDropEffects_DragDropEffects(IDataObject data, int keyState, int x, int y,
DragDropEffects
allowedEffect,
DragDropEffects
effect)
39
int y,
DragDropEffects
allowedEffect,
DragDropEffects
effect, DropImageType dropImageType, string message, string messageReplacementToken)
54
[InlineData(
DragDropEffects
.Copy)]
55
[InlineData((
DragDropEffects
.None - 1))]
56
public void Effect_Set_GetReturnsExpected(
DragDropEffects
value)
58
DragEventArgs e = new(new CustomDataObject(), 1, 2, 3,
DragDropEffects
.Copy,
DragDropEffects
.Move)
70
DragEventArgs e = new(new CustomDataObject(), 1, 2, 3,
DragDropEffects
.Copy,
DragDropEffects
.Move, DropImageType.Copy, "Copy to %1", "Documents")
82
DragEventArgs e = new(new CustomDataObject(), 1, 2, 3,
DragDropEffects
.Copy,
DragDropEffects
.Move, DropImageType.Copy, "Move to %1", "Documents")
94
DragEventArgs e = new(new CustomDataObject(), 1, 2, 3,
DragDropEffects
.Copy,
DragDropEffects
.Move, DropImageType.Copy, "Move to %1", "Desktop")
System\Windows\Forms\GiveFeedbackEventArgsTests.cs (7)
14
[InlineData(
DragDropEffects
.None, true)]
15
[InlineData((
DragDropEffects
.None - 1), false)]
16
public void Ctor_DragDropEffects_Bool(
DragDropEffects
effect, bool useDefaultCursors)
27
GiveFeedbackEventArgs e = new(
DragDropEffects
.None, false, new Bitmap(1, 1), new Point(0, 0), false)
44
GiveFeedbackEventArgs e = new(
DragDropEffects
.None, false, new Bitmap(2, 2), new Point(0, 0), false)
62
GiveFeedbackEventArgs e = new(
DragDropEffects
.None, false)
74
GiveFeedbackEventArgs e = new(
DragDropEffects
.None, false, new Bitmap(1, 1), new Point(0, 0), false)
System\Windows\Forms\RichTextBoxTests.cs (7)
10741
allowedEffect:
DragDropEffects
.None,
10742
effect:
DragDropEffects
.None);
10769
allowedEffect:
DragDropEffects
.None,
10770
effect:
DragDropEffects
.None);
10818
allowedEffect:
DragDropEffects
.None,
10819
effect:
DragDropEffects
.None);
10841
GiveFeedbackEventArgs giveFeedbackEventArgs = new(
DragDropEffects
.None, useDefaultCursors: true);
System\Windows\Forms\ToolStripControlHostTests.cs (4)
3347
yield return new object[] { new DragEventArgs(null, 1, 2, 3,
DragDropEffects
.Copy,
DragDropEffects
.Move) };
3493
yield return new object[] { new GiveFeedbackEventArgs(
DragDropEffects
.None, true) };
4061
c.OnGiveFeedback(new GiveFeedbackEventArgs(
DragDropEffects
.All, false));
System\Windows\Forms\ToolStripDropDownTests.cs (1)
3862
yield return new object[] { new GiveFeedbackEventArgs(
DragDropEffects
.None, true) };
System\Windows\Forms\ToolStripItemTests.cs (16)
10150
foreach (
DragDropEffects
allowedEffects in Enum.GetValues(typeof(
DragDropEffects
)))
10164
public void ToolStripItem_DoDragDrop_Invoke_ReturnsNone(object data,
DragDropEffects
allowedEffects)
10167
Assert.Equal(
DragDropEffects
.None, item.DoDragDrop(data, allowedEffects));
10173
public void ToolStripItem_DoDragDrop_InvokeWithParent_ReturnsNone(object data,
DragDropEffects
allowedEffects)
10180
Assert.Equal(
DragDropEffects
.None, item.DoDragDrop(data, allowedEffects));
10187
public void ToolStripItem_DoDragDrop_InvokeWithParentAllowItemReorder_ReturnsNone(object data,
DragDropEffects
allowedEffects)
10197
Assert.Equal(
DragDropEffects
.None, item.DoDragDrop(data, allowedEffects));
10204
public void ToolStripItem_DoDragDrop_InvokeWithOwner_ReturnsNone(object data,
DragDropEffects
allowedEffects)
10211
Assert.Equal(
DragDropEffects
.None, item.DoDragDrop(data, allowedEffects));
10218
public void ToolStripItem_DoDragDrop_InvokeWithOwnerAllowItemReorder_ReturnsNone(object data,
DragDropEffects
allowedEffects)
10228
Assert.Equal(
DragDropEffects
.None, item.DoDragDrop(data, allowedEffects));
10237
Assert.Throws<ArgumentNullException>("data", () => item.DoDragDrop(null,
DragDropEffects
.All));
10993
yield return new object[] { new DragEventArgs(null, 0, 0, 0,
DragDropEffects
.None,
DragDropEffects
.None) };
11698
yield return new object[] { new GiveFeedbackEventArgs(
DragDropEffects
.None, true) };
System\Windows\Forms\ToolStripSplitStackDragDropHandlerTests.cs (17)
26
DragEventArgs dragEventArgs = new(dataObject, 0, 0, 0,
DragDropEffects
.None,
DragDropEffects
.None);
30
dragEventArgs.Effect.Should().Be(
DragDropEffects
.Move);
37
DragEventArgs dragEventArgs = new(dataObject, 0, 0, 0,
DragDropEffects
.None,
DragDropEffects
.None);
41
dragEventArgs.Effect.Should().Be(
DragDropEffects
.None);
50
DragEventArgs dragEventArgs = new(dataObject, 0, 0, 0,
DragDropEffects
.None,
DragDropEffects
.None);
61
DragEventArgs dragEventArgs = new(dataObject, 0, 0, 0,
DragDropEffects
.None,
DragDropEffects
.None);
74
DragEventArgs dragEventArgs = new(dataObject, 0, 0, 0,
DragDropEffects
.None,
DragDropEffects
.None);
78
dragEventArgs.Effect.Should().Be(
DragDropEffects
.Move);
85
DragEventArgs dragEventArgs = new(dataObject, 0, 0, 0,
DragDropEffects
.None,
DragDropEffects
.None);
89
dragEventArgs.Effect.Should().Be(
DragDropEffects
.None);
95
GiveFeedbackEventArgs giveFeedbackEventArgs = new(effect:
DragDropEffects
.None, useDefaultCursors: false);
System.Windows.Forms.UI.IntegrationTests (44)
DesignBehaviorsTests.cs (2)
118
var
effects = node.TreeView!.DoDragDrop(dataObject!,
DragDropEffects
.Copy);
DragDropTests.cs (42)
74
e.Effect =
DragDropEffects
.Copy;
83
e.Effect =
DragDropEffects
.Copy;
98
form.DoDragDrop(data,
DragDropEffects
.Copy);
290
e.Effect =
DragDropEffects
.Copy;
299
e.Effect =
DragDropEffects
.Copy;
313
form.DoDragDrop(data,
DragDropEffects
.Copy);
361
e.Effect =
DragDropEffects
.Copy;
509
e.Effect =
DragDropEffects
.Copy;
518
e.Effect =
DragDropEffects
.Copy;
523
form.DoDragDropAsJson(testData,
DragDropEffects
.Copy);
768
DragDropEffects
dropEffect = ListDragSource.DoDragDrop(
770
DragDropEffects
.All |
DragDropEffects
.Link);
773
if (dropEffect ==
DragDropEffects
.Move)
804
if ((e.Effect &
DragDropEffects
.Move) ==
DragDropEffects
.Move)
819
e.Effect =
DragDropEffects
.None;
826
(e.AllowedEffect &
DragDropEffects
.Link) ==
DragDropEffects
.Link)
831
e.Effect =
DragDropEffects
.Link;
834
(e.AllowedEffect &
DragDropEffects
.Link) ==
DragDropEffects
.Link)
837
e.Effect =
DragDropEffects
.Link;
840
(e.AllowedEffect &
DragDropEffects
.Move) ==
DragDropEffects
.Move)
843
e.Effect =
DragDropEffects
.Move;
846
(e.AllowedEffect &
DragDropEffects
.Copy) ==
DragDropEffects
.Copy)
849
e.Effect =
DragDropEffects
.Copy;
851
else if ((e.AllowedEffect &
DragDropEffects
.Move) ==
DragDropEffects
.Move)
854
e.Effect =
DragDropEffects
.Move;
858
e.Effect =
DragDropEffects
.None;
890
if (item is not null && (e.Effect ==
DragDropEffects
.Copy || e.Effect ==
DragDropEffects
.Move))
1073
e.Effect =
DragDropEffects
.Link;
1090
dragAcceptItem.DoDragDrop(data,
DragDropEffects
.All, _dragAcceptBmp, new Point(0, 16), false);
1099
e.Effect =
DragDropEffects
.None;
1113
e.Effect =
DragDropEffects
.None;
1129
e.Effect =
DragDropEffects
.Link;
1138
e.Effect =
DragDropEffects
.None;
1150
PictureBoxDragSource.DoDragDrop(data,
DragDropEffects
.All, _dragImage, new Point(0, 16), false);
TrimTest (2)
Form1.cs (2)
21
e.Effect =
DragDropEffects
.Copy;
29
e.Effect =
DragDropEffects
.Copy;
WinFormsControlsTest (23)
DragDrop.cs (23)
102
e.Effect =
DragDropEffects
.None;
126
e.Effect =
DragDropEffects
.Copy;
138
e.Effect =
DragDropEffects
.None;
151
e.Effect =
DragDropEffects
.Copy;
183
pictureBox.DoDragDrop(data,
DragDropEffects
.All, _nyanCatBmp, new Point(0, 96), true);
189
if (e.Effect.Equals(
DragDropEffects
.Copy))
226
e.Effect =
DragDropEffects
.None;
243
e.Effect =
DragDropEffects
.Copy;
250
e.Effect =
DragDropEffects
.None;
264
e.Effect =
DragDropEffects
.None;
285
e.Effect =
DragDropEffects
.Copy;
292
e.Effect =
DragDropEffects
.None;
306
e.Effect =
DragDropEffects
.None;
325
e.Effect =
DragDropEffects
.Link;
332
e.Effect =
DragDropEffects
.None;
339
e.Effect =
DragDropEffects
.None;
353
e.Effect =
DragDropEffects
.None;
515
e.Effect =
DragDropEffects
.Link;
522
e.Effect =
DragDropEffects
.Link;
529
e.Effect =
DragDropEffects
.Link;
546
toolStripItem.DoDragDrop(data,
DragDropEffects
.All, _dragAcceptBmp, new Point(0, 96), true);
558
toolStripItem.DoDragDrop(data,
DragDropEffects
.All, _nyanCatBmp, new Point(0, 96), true);
570
toolStripItem.DoDragDrop(data,
DragDropEffects
.All, _nyanCatAscii301Bmp, new Point(0, 111), false);