1 write to Data
System.Windows.Forms (1)
System\Windows\Forms\OLE\DragEventArgs.cs (1)
40
Data
= data;
110 references to Data
System.Windows.Forms (19)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropTargetManager.cs (6)
63
if (_owner.AllowItemReorder && e.
Data
is not null && e.
Data
.GetDataPresent(typeof(ToolStripItem)))
104
if (_owner.AllowItemReorder && e.
Data
is not null && e.
Data
.GetDataPresent(typeof(ToolStripItem)))
201
DragDropHelper.ClearDropDescription(e.
Data
);
211
DragEventArgs dragEnterArgs = new(e.
Data
, e.KeyState, e.X, e.Y, e.AllowedEffect, e.Effect, e.DropImageType, e.Message, e.MessageReplacementToken)
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitStackDragDropHandler.cs (7)
23
if (e.
Data
is not null && e.
Data
.GetDataPresent(typeof(ToolStripItem)))
37
if (e.
Data
is not null && e.
Data
.GetDataPresent(typeof(ToolStripItem)))
39
ToolStripItem item = (ToolStripItem)e.
Data
.GetData(typeof(ToolStripItem))!;
46
if (e.
Data
is not null && e.
Data
.GetDataPresent(typeof(ToolStripItem)))
System\Windows\Forms\OLE\DragDropHelper.cs (3)
77
if (e.
Data
is not IComDataObject dataObject)
139
if (!TryGetDragDropHelper<IDropTargetHelper>(dropTargetHelper) || e.
Data
is not IComDataObject dataObject)
383
if (e.
Data
is not IComDataObject dataObject)
System\Windows\Forms\OLE\DragEventArgs.cs (3)
123
&& dragEventArgs.
Data
is not null
124
&& dragEventArgs.
Data
.Equals(
Data
)
System.Windows.Forms.Design (33)
System\Windows\Forms\Design\Behavior\BehaviorService.AdornerWindow.cs (2)
175
if (e.
Data
is DropSourceBehavior.BehaviorDataObject)
182
string[] allFormats = e.
Data
!.GetFormats();
System\Windows\Forms\Design\Behavior\ToolboxSnapDragDropEventArgs.cs (1)
22
: base(origArgs.
Data
, origArgs.KeyState, origArgs.X, origArgs.Y, origArgs.AllowedEffect, origArgs.Effect)
System\Windows\Forms\Design\Behavior\ToolStripPanelSelectionBehavior.cs (7)
224
if (e.
Data
is DropSourceBehavior.BehaviorDataObject data)
262
else if (e.
Data
is DataObject && components is null)
269
ToolboxItem item = toolboxService.DeserializeToolboxItem(e.
Data
, host);
291
if (e.
Data
is not null)
293
e.Effect = GetEffect(e.
Data
);
301
if (e.
Data
is not null)
303
e.Effect = GetEffect(e.
Data
);
System\Windows\Forms\Design\ComponentTray.cs (1)
1124
_mouseDragTool = _toolboxService.DeserializeToolboxItem(de.
Data
, (IDesignerHost)GetService(typeof(IDesignerHost)));
System\Windows\Forms\Design\DocumentDesigner.cs (1)
282
return de.
Data
is not ToolStripItemDataObject;
System\Windows\Forms\Design\FlowLayoutPanelDesigner .cs (1)
758
if (de.
Data
is DropSourceBehavior.BehaviorDataObject data)
System\Windows\Forms\Design\OleDragDropHandler.cs (3)
671
IDataObject dataObj = de.
Data
!;
870
if (!Dragging && CanDropDataObject(de.
Data
) && de.AllowedEffect != DragDropEffects.None)
1035
public static object[]? GetDraggingObjects(DragEventArgs de) => GetDraggingObjects(de.
Data
);
System\Windows\Forms\Design\ParentControlDesigner.cs (5)
1370
DropSourceBehavior.BehaviorDataObject data = de.
Data
as DropSourceBehavior.BehaviorDataObject;
1388
DropSourceBehavior.BehaviorDataObject data = de.
Data
as DropSourceBehavior.BehaviorDataObject;
1454
DropSourceBehavior.BehaviorDataObject data = de.
Data
as DropSourceBehavior.BehaviorDataObject;
1583
_mouseDragTool = _toolboxService.DeserializeToolboxItem(de.
Data
, host);
1657
if (de.
Data
is DropSourceBehavior.BehaviorDataObject data)
System\Windows\Forms\Design\TabControlDesigner.cs (1)
503
DropSourceBehavior.BehaviorDataObject data = de.
Data
as DropSourceBehavior.BehaviorDataObject;
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (1)
953
if (de.
Data
is DropSourceBehavior.BehaviorDataObject data)
System\Windows\Forms\Design\ToolStripDesigner.cs (2)
1826
if (!(de.
Data
is ToolStripItemDataObject data) || data.Owner != parentToolStrip)
2277
if (de.
Data
is ToolStripItemDataObject data)
System\Windows\Forms\Design\ToolStripItemBehavior.cs (3)
647
if (e.
Data
is ToolStripItemDataObject data && currentDropItem is not null)
846
if (e.
Data
is ToolStripItemDataObject data)
883
if (e.
Data
is ToolStripItemDataObject)
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (3)
2649
if (e.
Data
is ToolStripItemDataObject)
2664
if (e.
Data
is ToolStripItemDataObject)
2679
if (e.
Data
is ToolStripItemDataObject data)
System\Windows\Forms\Design\TreeNodeCollectionEditor.cs (2)
515
if (e.
Data
.GetDataPresent(typeof(TreeNode)))
527
TreeNode dragNode = (TreeNode)e.
Data
.GetData(typeof(TreeNode));
System.Windows.Forms.Tests (4)
System\Windows\Forms\DragDropHelperTests.cs (2)
271
e.
Data
.TryGetData(PInvoke.CFSTR_DROPDESCRIPTION, out DragDropFormat dragDropFormat).Should().BeTrue();
284
if (e.
Data
is IComDataObject dataObject)
System\Windows\Forms\DragEventArgsTests.cs (2)
26
Assert.Equal(data, e.
Data
);
40
Assert.Equal(data, e.
Data
);
System.Windows.Forms.UI.IntegrationTests (19)
DragDropTests.cs (19)
72
if (e.
Data
?.GetDataPresent(typeof(Button)) ?? false)
79
if (e.
Data
?.GetDataPresent(typeof(Button)) ?? false)
82
data = (Button?)e.
Data
?.GetData(typeof(Button));
288
if (e.
Data
?.GetDataPresent(DataFormats.Serializable) ?? false)
295
if (e.
Data
?.GetDataPresent(DataFormats.Serializable) ?? false)
298
data = (ListViewItem?)e.
Data
?.GetData(DataFormats.Serializable);
507
if (e.
Data
?.GetDataPresent(typeof(SimpleTestData)) ?? false)
514
if (e.
Data
?.TryGetData(out SimpleTestData data) ?? false)
817
if (e.
Data
is null || !e.
Data
.GetDataPresent(typeof(string)))
885
if (e.
Data
is not null && e.
Data
.GetDataPresent(typeof(string)))
887
object? item = e.
Data
.GetData(typeof(string));
1106
if (e.
Data
is not null
1107
&& e.
Data
.GetDataPresent(DataFormats.FileDrop)
1108
&& e.
Data
.GetData(DataFormats.FileDrop) is string[] fileNames
1121
if (e.
Data
is not null
1122
&& e.
Data
.GetDataPresent(DataFormats.FileDrop)
1123
&& e.
Data
.GetData(DataFormats.FileDrop) is string[] fileNames
TrimTest (3)
Form1.cs (3)
19
if (e.
Data
is { } dataObject && dataObject.GetDataPresent(DataFormats.UnicodeText))
27
if (e.
Data
is { } dataObject && dataObject.GetDataPresent(DataFormats.UnicodeText))
35
if (e.
Data
is { } dataObject && dataObject.GetData(DataFormats.UnicodeText) is string text)
WinFormsControlsTest (32)
DragDrop.cs (32)
107
if (sender is not PictureBox pictureBox || e.
Data
is null)
112
if (e.
Data
.GetDataPresent(DataFormats.FileDrop)
113
&& e.
Data
.GetData(DataFormats.FileDrop) is string[] files
141
else if (e.
Data
.GetDataPresent(nameof(_nyanCatBmp)))
157
if (sender is PictureBox pictureBox && e.
Data
is not null)
159
if (e.
Data
.GetDataPresent(DataFormats.FileDrop)
160
&& e.
Data
.GetData(DataFormats.FileDrop) is string[] files
166
else if (e.
Data
.GetDataPresent(nameof(_nyanCatBmp))
167
&& e.
Data
.GetData(nameof(_nyanCatBmp)) is Bitmap nyanCatBmp)
211
if (e.
Data
is not null
212
&& e.
Data
.GetDataPresent(nameof(_nyanCatAscii), false)
213
&& e.
Data
.GetData(nameof(_nyanCatAscii)) is string asciiCat)
228
if (e.
Data
is null)
233
if (e.
Data
.GetDataPresent(nameof(_nyanCatAscii)))
245
else if (e.
Data
.GetDataPresent(nameof(_nyanCatBmp)))
252
else if (e.
Data
.GetDataPresent(DataFormats.FileDrop)
253
&& e.
Data
.GetData(DataFormats.FileDrop) is string[] files
270
if (e.
Data
is null)
275
if (e.
Data
.GetDataPresent(nameof(_nyanCatAscii)))
287
else if (e.
Data
.GetDataPresent(nameof(_nyanCatBmp)))
294
else if (e.
Data
.GetDataPresent(DataFormats.FileDrop)
295
&& e.
Data
.GetData(DataFormats.FileDrop) is string[] files
312
if (e.
Data
is null)
317
if (e.
Data
.GetDataPresent(DataFormats.FileDrop)
318
&& e.
Data
.GetDataPresent("FileName")
319
&& e.
Data
.GetData("FileName") is string[] fileNames
327
else if (e.
Data
.GetDataPresent(nameof(_nyanCatAscii)))
334
else if (e.
Data
.GetDataPresent(nameof(_nyanCatBmp)))
345
if (e.
Data
is not null
346
&& e.
Data
.GetDataPresent(DataFormats.FileDrop)
347
&& e.
Data
.GetDataPresent("FileName")
348
&& e.
Data
.GetData("FileName") is string[] fileNames