11 implementations of IDataObject
ComDisabled.Tests (1)
DataObjectComTests.cs (1)
50private class CustomIDataObject : IDataObject
System.Windows.Forms (4)
System\Windows\Forms\OLE\DataObject.Composition.cs (1)
16internal unsafe partial class Composition : IDataObject, Com.IDataObject.Interface, ComTypes.IDataObject
System\Windows\Forms\OLE\DataObject.Composition.NativeToWinFormsAdapter.cs (1)
19private unsafe class NativeToWinFormsAdapter : IDataObject, Com.IDataObject.Interface
System\Windows\Forms\OLE\DataObject.cs (1)
18IDataObject,
System\Windows\Forms\OLE\DataObject.DataStore.cs (1)
12private class DataStore : IDataObject
System.Windows.Forms.Design (1)
System\Windows\Forms\Design\OleDragDropHandler.ComponentDataObject.cs (1)
14protected class ComponentDataObject : IDataObject
System.Windows.Forms.Tests (5)
System\Windows\Forms\ClipboardTests.cs (1)
557private class CustomDataObject : IDataObject, ComTypes.IDataObject
System\Windows\Forms\DataObjectComTests.cs (1)
51private class CustomIDataObject : IDataObject
System\Windows\Forms\DataObjectTests.cs (1)
2387private class CustomDataObject : IComDataObject, IDataObject
System\Windows\Forms\DragEventArgsTests.cs (1)
99private class CustomDataObject : IDataObject
System\Windows\Forms\ToolStripItemTests.cs (1)
10238private class CustomDataObject : IDataObject
144 references to IDataObject
ComDisabled.Tests (3)
DataObjectComTests.cs (3)
12private delegate IDataObject CreateWinFormsDataObjectForOutgoingDropData(Com.IDataObject* dataObject); 27IDataObject outData = dropTargetAccessor.CreateDelegate<CreateWinFormsDataObjectForOutgoingDropData>()(inDataPtr); 45IDataObject outData = dropTargetAccessor.CreateDelegate<CreateWinFormsDataObjectForOutgoingDropData>()(inDataPtr);
Microsoft.CodeAnalysis.EditorFeatures.Wpf (2)
StringCopyPaste\WpfStringCopyPasteService.cs (2)
36var dataObject = Clipboard.GetDataObject(); 69var dataObject = Clipboard.GetDataObject();
Microsoft.VisualBasic.Forms (2)
Microsoft\VisualBasic\MyServices\ClipboardProxy.vb (2)
101''' Gets a <see cref="IDataObject"/> from the clipboard. 106Public Function GetDataObject() As IDataObject
System.Windows.Forms (68)
System\Windows\Forms\Control.cs (1)
4801/// <see cref="object"/> that implements <see cref="IDataObject"/>. <paramref name="dragImage"/> is the bitmap
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (1)
1045IDataObject? dataObj = Clipboard.GetDataObject();
System\Windows\Forms\Controls\RichTextBox\RichTextBox.OleCallback.cs (1)
19private IDataObject? _lastDataObject;
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (2)
2147/// <paramref name="data"/> can also be any <see cref="object"/> that implements <see cref="IDataObject"/>. 2173if (data is IDataObject idataObject)
System\Windows\Forms\OLE\Clipboard.cs (4)
79public static unsafe IDataObject? GetDataObject() 146return dataObject is IDataObject ido && !Marshal.IsComObject(dataObject) 189GetDataObject() is IDataObject dataObject && dataObject.GetDataPresent(format, autoConvert: autoConvert); 233GetDataObject() is IDataObject dataObject ? dataObject.GetData(format, autoConvert) : null;
System\Windows\Forms\OLE\DataObject.Composition.cs (18)
13/// Contains the logic to move between <see cref="IDataObject"/>, <see cref="Com.IDataObject.Interface"/>, 32private readonly IDataObject _winFormsDataObject; 44private Composition(IDataObject winFormsDataObject, Com.IDataObject.Interface nativeDataObject, ComTypes.IDataObject runtimeDataObject) 55public static Composition CreateFromWinFormsDataObject(IDataObject winFormsDataObject) 80/// The <see cref="IDataObject"/> the user passed to us, so that it can be passed back out. 82public IDataObject? OriginalIDataObject { get; private set; } 107object? IDataObject.GetData(string format, bool autoConvert) => _winFormsDataObject.GetData(format, autoConvert); 108object? IDataObject.GetData(string format) => _winFormsDataObject.GetData(format); 109object? IDataObject.GetData(Type format) => _winFormsDataObject.GetData(format); 110bool IDataObject.GetDataPresent(string format, bool autoConvert) => _winFormsDataObject.GetDataPresent(format, autoConvert); 111bool IDataObject.GetDataPresent(string format) => _winFormsDataObject.GetDataPresent(format); 112bool IDataObject.GetDataPresent(Type format) => _winFormsDataObject.GetDataPresent(format); 113string[] IDataObject.GetFormats(bool autoConvert) => _winFormsDataObject.GetFormats(autoConvert); 114string[] IDataObject.GetFormats() => _winFormsDataObject.GetFormats(); 115void IDataObject.SetData(string format, bool autoConvert, object? data) => _winFormsDataObject.SetData(format, autoConvert, data); 116void IDataObject.SetData(string format, object? data) => _winFormsDataObject.SetData(format, data); 117void IDataObject.SetData(Type format, object? data) => _winFormsDataObject.SetData(format, data); 118void IDataObject.SetData(object? data) => _winFormsDataObject.SetData(data);
System\Windows\Forms\OLE\DataObject.Composition.NativeToWinFormsAdapter.cs (11)
17/// Maps native pointer <see cref="Com.IDataObject"/> to <see cref="IDataObject"/>. 396object? IDataObject.GetData(string format, bool autoConvert) 432object? IDataObject.GetData(string format) => ((IDataObject)this).GetData(format, autoConvert: true); 434object? IDataObject.GetData(Type format) => ((IDataObject)this).GetData(format.FullName!); 436bool IDataObject.GetDataPresent(Type format) => GetDataPresent(format.FullName!); 504void IDataObject.SetData(string format, bool autoConvert, object? data) { } 505void IDataObject.SetData(string format, object? data) { } 506void IDataObject.SetData(Type format, object? data) { } 507void IDataObject.SetData(object? data) { }
System\Windows\Forms\OLE\DataObject.Composition.WinFormsToNativeAdapter.cs (3)
18/// Maps <see cref="IDataObject"/> to <see cref="Com.IDataObject.Interface"/>. 24private readonly IDataObject _dataObject; 26public WinFormsToNativeAdapter(IDataObject dataObject)
System\Windows\Forms\OLE\DataObject.cs (11)
52else if (data is IDataObject iDataObject) 82/// <see cref="IDataObject"/>. Otherwise, returns this. 85internal IDataObject TryUnwrapInnerIDataObject() 92internal IDataObject? OriginalIDataObject => _innerData.OriginalIDataObject; 96((IDataObject)_innerData).GetData(format, autoConvert); 103((IDataObject)_innerData).GetDataPresent(format, autoConvert); 109public virtual string[] GetFormats(bool autoConvert) => ((IDataObject)_innerData).GetFormats(autoConvert); 114=> ((IDataObject)_innerData).SetData(format, autoConvert, data); 116public virtual void SetData(string format, object? data) => ((IDataObject)_innerData).SetData(format, data); 118public virtual void SetData(Type format, object? data) => ((IDataObject)_innerData).SetData(format, data); 120public virtual void SetData(object? data) => ((IDataObject)_innerData).SetData(data);
System\Windows\Forms\OLE\DataObject.FormatEnumerator.cs (3)
17private readonly IDataObject _parent; 21public FormatEnumerator(IDataObject parent) : this(parent, parent.GetFormats()) 32public FormatEnumerator(IDataObject parent, string[]? formats)
System\Windows\Forms\OLE\DragDropHelper.cs (3)
61public static void ClearDropDescription(IDataObject? dataObject) 194public static unsafe bool IsInDragLoop(IDataObject dataObject) 244if (comDataObject is not IDataObject dataObject)
System\Windows\Forms\OLE\DragEventArgs.cs (4)
16IDataObject? data, 30IDataObject? data, 52/// The <see cref="IDataObject"/> that contains the data associated 55public IDataObject? Data { get; }
System\Windows\Forms\OLE\DropTarget.cs (6)
14private IDataObject? _lastDataObject; 43/// Creates <see cref="IDataObject"/> to be passed out as data for drag/drop operation 45/// <see cref="IDataObject"/> to be passed out as is. Otherwise, the data will be wrapped in a <see cref="DataObject"/>. 47private static IDataObject? CreateWinFormsDataObjectForOutgoingDropData(Com.IDataObject* nativeDataObject) 50if (ComWrappers.TryGetObject(unknown, out object? obj) && obj is IDataObject dataObject) 63IDataObject? data;
System.Windows.Forms.Design (16)
System\Windows\Forms\Design\Behavior\ToolStripPanelSelectionBehavior.cs (1)
309private static DragDropEffects GetEffect(IDataObject data)
System\Windows\Forms\Design\CommandSet.cs (4)
1415IDataObject dataObj = new DataObject(CF_DESIGNER, bytes); 1460IDataObject dataObj = new DataObject(CF_DESIGNER, bytes); 1846bool clipboardOperationSuccessful = ExecuteSafely(Clipboard.GetDataObject, false, out IDataObject? dataObj); 3095bool clipboardOperationSuccessful = ExecuteSafely(Clipboard.GetDataObject, false, out IDataObject? dataObj);
System\Windows\Forms\Design\ComponentTray.cs (1)
2905protected override bool CanDropDataObject(IDataObject dataObj)
System\Windows\Forms\Design\DocumentDesigner.cs (3)
286private AxToolboxItem CreateAxToolboxItem(IDataObject dataObject) 318private static ToolboxItem CreateCfCodeToolboxItem(IDataObject dataObject) 1060if (serializedData is not IDataObject dataObject)
System\Windows\Forms\Design\OleDragDropHandler.cs (7)
35private static Dictionary<IDataObject, IComponent>? s_currentDrags; 54private static IComponent? GetDragOwnerComponent(IDataObject data) 60private static void AddCurrentDrag(IDataObject data, IComponent component) 68protected virtual bool CanDropDataObject(IDataObject? dataObj) 671IDataObject dataObj = de.Data!; 1019private static object[]? GetDraggingObjects(IDataObject? dataObj, bool topLevelOnly) 1033public static object[]? GetDraggingObjects(IDataObject? dataObj) => GetDraggingObjects(dataObj, topLevelOnly: false);
System.Windows.Forms.Tests (53)
System\Windows\Forms\ClipboardTests.cs (19)
114IDataObject? result = Clipboard.GetDataObject(); 253var dataObject = Clipboard.GetDataObject(); 267var actual = Clipboard.GetDataObject(); 282var dataObject = Clipboard.GetDataObject(); 535IDataObject? clipboardDataObject = Clipboard.GetDataObject(); 540IDataObject? clipboardDataObject2 = Clipboard.GetDataObject(); 551IDataObject? clipboardDataObject = Clipboard.GetDataObject(); 581object IDataObject.GetData(string format, bool autoConvert) => format == "Foo" ? "Bar" : null!; 582object IDataObject.GetData(string format) => format == "Foo" ? "Bar" : null!; 583object IDataObject.GetData(Type format) => null!; 586bool IDataObject.GetDataPresent(string format, bool autoConvert) => format == "Foo"; 587bool IDataObject.GetDataPresent(string format) => format == "Foo"; 588bool IDataObject.GetDataPresent(Type format) => false; 589string[] IDataObject.GetFormats(bool autoConvert) => ["Foo"]; 590string[] IDataObject.GetFormats() => ["Foo"]; 592void IDataObject.SetData(string format, bool autoConvert, object? data) => throw new NotImplementedException(); 593void IDataObject.SetData(string format, object? data) => throw new NotImplementedException(); 594void IDataObject.SetData(Type format, object? data) => throw new NotImplementedException(); 595void IDataObject.SetData(object? data) => throw new NotImplementedException();
System\Windows\Forms\ControlTests.Methods.cs (1)
1819yield return new object[] { new Mock<IDataObject>(MockBehavior.Strict).Object, allowedEffects };
System\Windows\Forms\DataObjectComTests.cs (3)
12private delegate IDataObject CreateWinFormsDataObjectForOutgoingDropData(Com.IDataObject* dataObject); 28IDataObject outData = dropTargetAccessor.CreateDelegate<CreateWinFormsDataObjectForOutgoingDropData>()(inDataPtr); 46IDataObject outData = dropTargetAccessor.CreateDelegate<CreateWinFormsDataObjectForOutgoingDropData>()(inDataPtr);
System\Windows\Forms\DataObjectTests.cs (25)
287Mock<IDataObject> mockDataObject = new(MockBehavior.Strict); 318Mock<IDataObject> mockDataObject = new(MockBehavior.Strict); 409Mock<IDataObject> mockDataObject = new(MockBehavior.Strict); 440Mock<IDataObject> mockDataObject = new(MockBehavior.Strict); 591Mock<IDataObject> mockDataObject = new(MockBehavior.Strict); 646Mock<IDataObject> mockDataObject = new(MockBehavior.Strict); 856Mock<IDataObject> mockDataObject = new(MockBehavior.Strict); 914Mock<IDataObject> mockDataObject = new(MockBehavior.Strict); 998Mock<IDataObject> mockDataObject = new(MockBehavior.Strict); 1083Mock<IDataObject> mockDataObject = new(MockBehavior.Strict); 1166Mock<IDataObject> mockDataObject = new(MockBehavior.Strict); 1191Mock<IDataObject> mockDataObject = new(MockBehavior.Strict); 1287Mock<IDataObject> mockDataObject = new(MockBehavior.Strict); 1349Mock<IDataObject> mockDataObject = new(MockBehavior.Strict); 1427Mock<IDataObject> mockDataObject = new(MockBehavior.Strict); 1521Mock<IDataObject> mockDataObject = new(MockBehavior.Strict); 1771Mock<IDataObject> mockDataObject = new(MockBehavior.Strict); 1833Mock<IDataObject> mockDataObject = new(MockBehavior.Strict); 1881Mock<IDataObject> mockDataObject = new(MockBehavior.Strict); 1960Mock<IDataObject> mockDataObject = new(MockBehavior.Strict); 2023Mock<IDataObject> mockDataObject = new(MockBehavior.Strict); 2437IDataObject outData = dropTargetAccessor.CreateDelegate<CreateWinFormsDataObjectForOutgoingDropData>()(inDataPtr); 2452IDataObject outData = dropTargetAccessor.CreateDelegate<CreateWinFormsDataObjectForOutgoingDropData>()(inDataPtr); 2469IDataObject outData = dropTargetAccessor.CreateDelegate<CreateWinFormsDataObjectForOutgoingDropData>()(inDataPtr); 2485IDataObject outData = dropTargetAccessor.CreateDelegate<CreateWinFormsDataObjectForOutgoingDropData>()(inDataPtr);
System\Windows\Forms\DragDropHelperTests.cs (2)
76IDataObject dataObject = null; 216Assert.True(DragDropHelper.IsInDragLoop(dataObject as IDataObject));
System\Windows\Forms\DragEventArgsTests.cs (2)
23public void Ctor_IDataObject_Int_Int_Int_DragDropEffects_DragDropEffects(IDataObject data, int keyState, int x, int y, DragDropEffects allowedEffect, DragDropEffects effect) 36public void Ctor_IDataObject_Int_Int_Int_DragDropEffects_DragDropEffects_DropImageType_string_string(IDataObject data, int keyState, int x,
System\Windows\Forms\ToolStripItemTests.cs (1)
10154yield return new object[] { new Mock<IDataObject>(MockBehavior.Strict).Object, allowedEffects };