IDataObject Interface
TOC
Collapse the table of content
Expand the table of content

IDataObject Interface

 

Provides a format-independent mechanism for transferring data.

Namespace:   System.Windows
Assembly:  PresentationCore (in PresentationCore.dll)

public interface IDataObject

NameDescription
System_CAPS_pubmethodGetData(String)

Retrieves a data object in a specified format; the data format is specified by a string.

System_CAPS_pubmethodGetData(String, Boolean)

Retrieves a data object in a specified format, optionally converting the data to the specified format.

System_CAPS_pubmethodGetData(Type)

Retrieves a data object in a specified format; the data format is specified by a Type object.

System_CAPS_pubmethodGetDataPresent(String)

Checks to see whether the data is available in, or can be converted to, a specified format; the data format is specified by a string.

System_CAPS_pubmethodGetDataPresent(String, Boolean)

Checks to see whether the data is available in, or can be converted to, a specified format. A Boolean flag indicates whether to check if the data can be converted to the specified format, if it is not available in that format.

System_CAPS_pubmethodGetDataPresent(Type)

Checks to see whether the data is available in, or can be converted to, a specified format. The data format is specified by a Type object.

System_CAPS_pubmethodGetFormats()

Returns a list of all formats that the data in this data object is stored in, or can be converted to.

System_CAPS_pubmethodGetFormats(Boolean)

Returns a list of all formats that the data in this data object is stored in. A Boolean flag indicates whether or not to also include formats that the data can be automatically converted to.

System_CAPS_pubmethodSetData(Object)

Stores the specified data in this data object, automatically converting the data format from the source object type.

System_CAPS_pubmethodSetData(String, Object)

Stores the specified data in this data object, along with one or more specified data formats. The data format is specified by a string.

System_CAPS_pubmethodSetData(String, Object, Boolean)

Stores the specified data in this data object, along with one or more specified data formats. This overload includes a Boolean flag to indicate whether the data may be converted to another format on retrieval.

System_CAPS_pubmethodSetData(Type, Object)

Stores the specified data in this data object, along with one or more specified data formats. The data format is specified by a Type class.

The IDataObject interface is used by the Clipboard class for data transfer operations like drag-and-drop.

When implemented by a class, the IDataObject methods enable a single data object to offer data in multiple formats. Offering data in multiple formats tends to make the data usable by a wider variety of applications than if only a single data format were supported.

The DataObject class provides a basic implementation of the IDataObject interface.

.NET Framework
Available since 3.0
Silverlight
Available since 4.0
Windows Phone Silverlight
Available since 7.1
Return to top
Show:
© 2016 Microsoft