1 write to Data
System.Windows.Forms (1)
System\Windows\Forms\OLE\DragEventArgs.cs (1)
40
Data
= data;
108 references to Data
System.Windows.Forms (19)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropTargetManager.cs (6)
64
if (_owner.AllowItemReorder && e.
Data
is not null && e.
Data
.GetDataPresent(typeof(ToolStripItem)))
105
if (_owner.AllowItemReorder && e.
Data
is not null && e.
Data
.GetDataPresent(typeof(ToolStripItem)))
202
DragDropHelper.ClearDropDescription(e.
Data
);
212
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)
278
if (de.
Data
is 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;
1582
_mouseDragTool = _toolboxService.DeserializeToolboxItem(de.
Data
, host);
1656
if (de.
Data
is DropSourceBehavior.BehaviorDataObject data)
System\Windows\Forms\Design\TabControlDesigner.cs (1)
502
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)
1827
if (!(de.
Data
is ToolStripItemDataObject data) || data.Owner != parentToolStrip)
2278
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)
266
DragDropFormat dragDropFormat = (DragDropFormat)e.
Data
.GetData(PInvoke.CFSTR_DROPDESCRIPTION);
279
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 (17)
DragDropTests.cs (17)
70
if (e.
Data
?.GetDataPresent(typeof(Button)) ?? false)
77
if (e.
Data
?.GetDataPresent(typeof(Button)) ?? false)
80
data = (Button?)e.
Data
?.GetData(typeof(Button));
284
if (e.
Data
?.GetDataPresent(DataFormats.Serializable) ?? false)
291
if (e.
Data
?.GetDataPresent(DataFormats.Serializable) ?? false)
294
data = (ListViewItem?)e.
Data
?.GetData(DataFormats.Serializable);
758
if (e.
Data
is null || !e.
Data
.GetDataPresent(typeof(string)))
826
if (e.
Data
is not null && e.
Data
.GetDataPresent(typeof(string)))
828
object? item = e.
Data
.GetData(typeof(string));
1047
if (e.
Data
is not null
1048
&& e.
Data
.GetDataPresent(DataFormats.FileDrop)
1049
&& e.
Data
.GetData(DataFormats.FileDrop) is string[] fileNames
1062
if (e.
Data
is not null
1063
&& e.
Data
.GetDataPresent(DataFormats.FileDrop)
1064
&& 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