NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

IDataObject Interface

Provides a format-independent mechanism for transferring data.

IDataObject

[Visual Basic]
Public Interface IDataObject
[C#]
public interface IDataObject
[C++]
public __gc __interface IDataObject

[JScript] In JScript, you can use the interfaces in the NGWS frameworks, but you cannot define your own.

Classes that Implement IDataObject

Class Description
DataObject Implements a basic data transfer mechanism.

Remarks

The IDataObject interface is used by the Clipboard class, and in drag-and-drop operations.

When implemented in a class, the IDataObject methods allow the user to store data in multiple formats in an instance of the class. Storing data in more than one format increases the chance that a target application, whose format requirements you may not know, can retrieve the stored data. To store data in an instance of IDataObject, call SetData and specify the data format in the format parameter. Set the autoConvert parameter to false if you do not want stored data to be converted to another format when it is retrieved. Invoke SetData multiple times on one instance of IDataObject to store data in more than one format.

You retrieve stored data from an IDataObject by calling GetData and specifying the data format in the format parameter. Set the autoConvert parameter to false to retrieve only data that was stored in the specified format. To convert the stored data to the specified format, set autoConvert to true, or do not use autoConvert.

To determine the formats of the data stored in an IDataObject, use the following IDataObject methods.

See the DataObject class for an implementation of this interface. See the DataFormats class for the predefined Clipboard data formats.

Requirements

Namespace: System.WinForms

Assembly: System.WinForms.dll

See Also

IDataObject Members | System.WinForms Namespace | DataObject | DataFormats