System.Windows.Forms
1.0.5000.0
2.0.0.0
System.Runtime.InteropServices.ComVisible(true)
The IDataObject interface is used by the class and in drag-and-drop operations.
When implemented in a class, the 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 might not know, can retrieve the stored data. To store data in an instance of , call the method and specify the data format in the parameter. Set the parameter to false if you do not want stored data to be converted to another format when it is retrieved. Invoke multiple times on one instance of to store data in more than one format.
You retrieve stored data from an by calling the method and specifying the data format in the parameter. Set the parameter to false to retrieve only data that was stored in the specified format. To convert the stored data to the specified format, set to true, or do not use .
To determine the formats of the data stored in an , use the following methods.
-
Call the method to retrieve an array of all the formats in which the data is available. Set the parameter to false to get only the formats in which the data is stored. To get all the formats in which the data is available, set to true, or do not use this parameter.
-
Call the method to determine whether stored data is available in a certain format. If you do not want stored data to be converted to the specified format, set the parameter to false.
See the class for an implementation of this interface. See the class for the predefined data formats.
Provides a format-independent mechanism for transferring data.
Method
System.Object
If this method cannot find data in the specified format, it attempts to convert the data to the format. If the data cannot be converted to the specified format, this method returns null.
To determine whether data is associated with, or can be converted to, a format, call before calling . Call for a list of valid formats for the data stored in this instance.
Data can be converted to another format if it was stored specifying that conversion is allowed, and if the requested format is compatible with the stored format. For example, data stored as Unicode can be converted to text.
For an implementation of this method, see .
Retrieves the data associated with the specified data format.
The data associated with the specified format, or null.
The format of the data to retrieve. See for predefined formats.
1.0.5000.0
2.0.0.0
Method
System.Object
If this method cannot find data in the specified format, it attempts to convert the data to the format. If the data cannot be converted to the specified format, this method returns null.
To determine whether data is associated with, or can be converted to, a format, call before calling . Call for a list of valid formats for the data stored in this instance.
Data can be converted to another format if it was stored specifying that conversion is allowed, and if the requested format is compatible with the stored format. For example, data stored as Unicode can be converted to text.
For an implementation of this method, see .
Retrieves the data associated with the specified class type format.
The data associated with the specified format, or null.
A representing the format of the data to retrieve. See for predefined formats.
1.0.5000.0
2.0.0.0
Method
System.Object
If the parameter is true and this method cannot find data in the specified format, it attempts to convert the data to the format. If the data cannot be converted to the specified format, or if the data was stored with the parameter set to false, this method returns null.
If the parameter is false, this method returns data in the specified format, or null if no data in this format can be found.
To determine whether data is associated with, or can be converted to, a format, call before calling . Call for a list of valid formats for the data stored in this instance.
Data can be converted to another format if it was stored specifying that conversion is allowed, and if the requested format is compatible with the stored format. For example, data stored as Unicode can be converted to text.
For an implementation of this method, see .
Retrieves the data associated with the specified data format, using a Boolean to determine whether to convert the data to the format.
The data associated with the specified format, or null.
The format of the data to retrieve. See for predefined formats.
true to convert the data to the specified format; otherwise, false.
1.0.5000.0
2.0.0.0
Method
System.Boolean
Call this method to determine whether a format exists in this before calling . Call for the formats that are available in this instance.
Data can be converted to another format if it was stored specifying that conversion is allowed, and if the requested format is compatible with the stored format. For example, data stored as Unicode can be converted to text.
For an implementation of this method, see .
Determines whether data stored in this instance is associated with, or can be converted to, the specified format.
true if data stored in this instance is associated with, or can be converted to, the specified format; otherwise false.
The format for which to check. See for predefined formats.
1.0.5000.0
2.0.0.0
Method
System.Boolean
Call this method to determine whether a format exists in this before calling . Call for the formats that are available in this instance.
Data can be converted to another format if it was stored specifying that conversion is allowed, and if the requested format is compatible with the stored format. For example, data stored as Unicode can be converted to text.
For an implementation of this method, see .
Determines whether data stored in this instance is associated with, or can be converted to, the specified format.
true if data stored in this instance is associated with, or can be converted to, the specified format; otherwise, false.
A representing the format for which to check. See for predefined formats.
1.0.5000.0
2.0.0.0
Method
System.Boolean
Call this method to determine whether a format exists in this before calling . Call for the formats that are available in this instance.
This method returns true when:
-
The parameter is true and the data is in a format that can be converted to the appropriate format.
-
The parameter is false and the data is in the appropriate format.
This method returns false when:
-
The parameter is true and this method cannot find data in the specified format, and it cannot convert data to the specified format, or the data was stored with set to false.
-
The parameter is false, and data does not exist in this instance in the specified format.
Data can be converted to another format if it was stored specifying that conversion is allowed, and if the requested format is compatible with the stored format. For example, data stored as Unicode can be converted to text.
For an implementation of this method, see .
Determines whether data stored in this instance is associated with the specified format, using a Boolean value to determine whether to convert the data to the format.
true if the data is in, or can be converted to, the specified format; otherwise, false.
The format for which to check. See for predefined formats.
true to determine whether data stored in this instance can be converted to the specified format; false to check whether the data is in the specified format.
1.0.5000.0
2.0.0.0
Method
System.String[]
Call this method to get the supported data formats before calling the method. See the class for the predefined formats.
Data can be converted to another format if it was stored specifying that conversion is allowed, and if the requested format is compatible with the stored format. For example, data stored as Unicode can be converted to text.
For an implementation of this method, see .
Returns a list of all formats that data stored in this instance is associated with or can be converted to.
An array of the names that represents a list of all formats that are supported by the data stored in this object.
1.0.5000.0
2.0.0.0
Method
System.String[]
Call this method to get the supported data formats before calling the method. See the class for the predefined formats.
Data can be converted to another format if it was stored specifying that conversion is allowed, and if the requested format is compatible with the stored format. For example, data stored as Unicode can be converted to text.
For an implementation of this method, see .
Gets a list of all formats that data stored in this instance is associated with or can be converted to, using a Boolean value to determine whether to retrieve all formats that the data can be converted to or only native data formats.
An array of the names that represents a list of all formats that are supported by the data stored in this object.
true to retrieve all formats that data stored in this instance is associated with or can be converted to; false to retrieve only native data formats.
1.0.5000.0
2.0.0.0
Method
System.Void
The format is derived from the data class.
Data stored using this method can be converted to a compatible format when it is retrieved.
For an implementation of this method, see .
Stores the specified data in this instance, using the class of the data for the format.
The data to store.
1.0.5000.0
2.0.0.0
Method
System.Void
If you do not know the format of the target application, you can store data in multiple formats using this method.
Data stored using this method can be converted to a compatible format when it is retrieved.
For an implementation of this method, see .
Stores the specified data and its associated format in this instance.
The format associated with the data. See for predefined formats.
The data to store.
1.0.5000.0
2.0.0.0
Method
System.Void
If you do not know the format of the target application, you can store data in multiple formats using this method.
Data stored using this method can be converted to a compatible format when it is retrieved.
For an implementation of this method, see .
Stores the specified data and its associated class type in this instance.
A representing the format associated with the data. See for predefined formats.
The data to store.
1.0.5000.0
2.0.0.0
Method
System.Void
If you do not know the format of the target application, you can store data in multiple formats using this method.
For an implementation of this method, see .
Stores the specified data and its associated format in this instance, using a Boolean value to specify whether the data can be converted to another format.
The format associated with the data. See for predefined formats.
true to allow the data to be converted to another format; otherwise, false.
The data to store.
1.0.5000.0
2.0.0.0