1 write to Data
System.Windows.Forms (1)
System\Windows\Forms\OLE\DragEventArgs.cs (1)
40Data = data;
108 references to Data
System.Windows.Forms (19)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropTargetManager.cs (6)
64if (_owner.AllowItemReorder && e.Data is not null && e.Data.GetDataPresent(typeof(ToolStripItem))) 105if (_owner.AllowItemReorder && e.Data is not null && e.Data.GetDataPresent(typeof(ToolStripItem))) 202DragDropHelper.ClearDropDescription(e.Data); 212DragEventArgs 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)
23if (e.Data is not null && e.Data.GetDataPresent(typeof(ToolStripItem))) 37if (e.Data is not null && e.Data.GetDataPresent(typeof(ToolStripItem))) 39ToolStripItem item = (ToolStripItem)e.Data.GetData(typeof(ToolStripItem))!; 46if (e.Data is not null && e.Data.GetDataPresent(typeof(ToolStripItem)))
System\Windows\Forms\OLE\DragDropHelper.cs (3)
77if (e.Data is not IComDataObject dataObject) 139if (!TryGetDragDropHelper<IDropTargetHelper>(dropTargetHelper) || e.Data is not IComDataObject dataObject) 383if (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)
175if (e.Data is DropSourceBehavior.BehaviorDataObject) 182string[] 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)
224if (e.Data is DropSourceBehavior.BehaviorDataObject data) 262else if (e.Data is DataObject && components is null) 269ToolboxItem item = toolboxService.DeserializeToolboxItem(e.Data, host); 291if (e.Data is not null) 293e.Effect = GetEffect(e.Data); 301if (e.Data is not null) 303e.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)
278if (de.Data is ToolStripItemDataObject)
System\Windows\Forms\Design\FlowLayoutPanelDesigner .cs (1)
758if (de.Data is DropSourceBehavior.BehaviorDataObject data)
System\Windows\Forms\Design\OleDragDropHandler.cs (3)
671IDataObject dataObj = de.Data!; 870if (!Dragging && CanDropDataObject(de.Data) && de.AllowedEffect != DragDropEffects.None) 1035public static object[]? GetDraggingObjects(DragEventArgs de) => GetDraggingObjects(de.Data);
System\Windows\Forms\Design\ParentControlDesigner.cs (5)
1370DropSourceBehavior.BehaviorDataObject data = de.Data as DropSourceBehavior.BehaviorDataObject; 1388DropSourceBehavior.BehaviorDataObject data = de.Data as DropSourceBehavior.BehaviorDataObject; 1454DropSourceBehavior.BehaviorDataObject data = de.Data as DropSourceBehavior.BehaviorDataObject; 1582_mouseDragTool = _toolboxService.DeserializeToolboxItem(de.Data, host); 1656if (de.Data is DropSourceBehavior.BehaviorDataObject data)
System\Windows\Forms\Design\TabControlDesigner.cs (1)
502DropSourceBehavior.BehaviorDataObject data = de.Data as DropSourceBehavior.BehaviorDataObject;
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (1)
953if (de.Data is DropSourceBehavior.BehaviorDataObject data)
System\Windows\Forms\Design\ToolStripDesigner.cs (2)
1827if (!(de.Data is ToolStripItemDataObject data) || data.Owner != parentToolStrip) 2278if (de.Data is ToolStripItemDataObject data)
System\Windows\Forms\Design\ToolStripItemBehavior.cs (3)
647if (e.Data is ToolStripItemDataObject data && currentDropItem is not null) 846if (e.Data is ToolStripItemDataObject data) 883if (e.Data is ToolStripItemDataObject)
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (3)
2649if (e.Data is ToolStripItemDataObject) 2664if (e.Data is ToolStripItemDataObject) 2679if (e.Data is ToolStripItemDataObject data)
System\Windows\Forms\Design\TreeNodeCollectionEditor.cs (2)
515if (e.Data.GetDataPresent(typeof(TreeNode))) 527TreeNode dragNode = (TreeNode)e.Data.GetData(typeof(TreeNode));
System.Windows.Forms.Tests (4)
System\Windows\Forms\DragDropHelperTests.cs (2)
266DragDropFormat dragDropFormat = (DragDropFormat)e.Data.GetData(PInvoke.CFSTR_DROPDESCRIPTION); 279if (e.Data is IComDataObject dataObject)
System\Windows\Forms\DragEventArgsTests.cs (2)
26Assert.Equal(data, e.Data); 40Assert.Equal(data, e.Data);
System.Windows.Forms.UI.IntegrationTests (17)
DragDropTests.cs (17)
70if (e.Data?.GetDataPresent(typeof(Button)) ?? false) 77if (e.Data?.GetDataPresent(typeof(Button)) ?? false) 80data = (Button?)e.Data?.GetData(typeof(Button)); 284if (e.Data?.GetDataPresent(DataFormats.Serializable) ?? false) 291if (e.Data?.GetDataPresent(DataFormats.Serializable) ?? false) 294data = (ListViewItem?)e.Data?.GetData(DataFormats.Serializable); 758if (e.Data is null || !e.Data.GetDataPresent(typeof(string))) 826if (e.Data is not null && e.Data.GetDataPresent(typeof(string))) 828object? item = e.Data.GetData(typeof(string)); 1047if (e.Data is not null 1048&& e.Data.GetDataPresent(DataFormats.FileDrop) 1049&& e.Data.GetData(DataFormats.FileDrop) is string[] fileNames 1062if (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)
19if (e.Data is { } dataObject && dataObject.GetDataPresent(DataFormats.UnicodeText)) 27if (e.Data is { } dataObject && dataObject.GetDataPresent(DataFormats.UnicodeText)) 35if (e.Data is { } dataObject && dataObject.GetData(DataFormats.UnicodeText) is string text)
WinFormsControlsTest (32)
DragDrop.cs (32)
107if (sender is not PictureBox pictureBox || e.Data is null) 112if (e.Data.GetDataPresent(DataFormats.FileDrop) 113&& e.Data.GetData(DataFormats.FileDrop) is string[] files 141else if (e.Data.GetDataPresent(nameof(_nyanCatBmp))) 157if (sender is PictureBox pictureBox && e.Data is not null) 159if (e.Data.GetDataPresent(DataFormats.FileDrop) 160&& e.Data.GetData(DataFormats.FileDrop) is string[] files 166else if (e.Data.GetDataPresent(nameof(_nyanCatBmp)) 167&& e.Data.GetData(nameof(_nyanCatBmp)) is Bitmap nyanCatBmp) 211if (e.Data is not null 212&& e.Data.GetDataPresent(nameof(_nyanCatAscii), false) 213&& e.Data.GetData(nameof(_nyanCatAscii)) is string asciiCat) 228if (e.Data is null) 233if (e.Data.GetDataPresent(nameof(_nyanCatAscii))) 245else if (e.Data.GetDataPresent(nameof(_nyanCatBmp))) 252else if (e.Data.GetDataPresent(DataFormats.FileDrop) 253&& e.Data.GetData(DataFormats.FileDrop) is string[] files 270if (e.Data is null) 275if (e.Data.GetDataPresent(nameof(_nyanCatAscii))) 287else if (e.Data.GetDataPresent(nameof(_nyanCatBmp))) 294else if (e.Data.GetDataPresent(DataFormats.FileDrop) 295&& e.Data.GetData(DataFormats.FileDrop) is string[] files 312if (e.Data is null) 317if (e.Data.GetDataPresent(DataFormats.FileDrop) 318&& e.Data.GetDataPresent("FileName") 319&& e.Data.GetData("FileName") is string[] fileNames 327else if (e.Data.GetDataPresent(nameof(_nyanCatAscii))) 334else if (e.Data.GetDataPresent(nameof(_nyanCatBmp))) 345if (e.Data is not null 346&& e.Data.GetDataPresent(DataFormats.FileDrop) 347&& e.Data.GetDataPresent("FileName") 348&& e.Data.GetData("FileName") is string[] fileNames