Interface IDataObject
Provides a format-independent mechanism for transferring data.
Namespace: Microsoft.Windows
Assembly: OpenSilver.Controls.Toolkit.dll
Syntax
public interface IDataObject
Methods
| Improve this Doc View SourceGetData(String)
Retrieves a data object in a specified format; the data format is specified by a string.
Declaration
object GetData(string format)
Parameters
Type | Name | Description |
---|---|---|
System.String | format | A string that specifies what format to retrieve the data as. |
Returns
Type | Description |
---|---|
System.Object | A data object with the data in the specified format, or null if the data is not available in the specified format. |
GetData(String, Boolean)
Retrieves a data object in a specified format, optionally converting the data to the specified format.
Declaration
object GetData(string format, bool autoConvert)
Parameters
Type | Name | Description |
---|---|---|
System.String | format | A string that specifies what format to retrieve the data as. See the System.Windows.DataFormats class for a set of predefined data formats. |
System.Boolean | autoConvert | True to attempt to automatically convert the data to the specified format; false for no data format conversion. If this parameter is false, the method returns data in the specified format if available, or null if the data is not available in the specified format. |
Returns
Type | Description |
---|---|
System.Object | A data object with the data in the specified format, or null if the data is not available in the specified format. |
GetData(Type)
Retrieves a data object in a specified format; the data format is specified by a System.Type object.
Declaration
object GetData(Type format)
Parameters
Type | Name | Description |
---|---|---|
System.Type | format | A System.Type object that specifies what format to retrieve the data as. |
Returns
Type | Description |
---|---|
System.Object | A data object with the data in the specified format, or null if the data is not available in the specified format. |
GetDataPresent(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.
Declaration
bool GetDataPresent(string format)
Parameters
Type | Name | Description |
---|---|---|
System.String | format | A string that specifies what format to check for. |
Returns
Type | Description |
---|---|
System.Boolean | True if the data is in, or can be converted to, the specified format; otherwise, false. |
GetDataPresent(String, Boolean)
Determines whether the data is available in, or can be converted to, a format specified by a System.Type object.
Declaration
bool GetDataPresent(string format, bool autoConvert)
Parameters
Type | Name | Description |
---|---|---|
System.String | format | A System.Type that specifies the format for the data. |
System.Boolean | autoConvert | True to attempt to automatically convert the data to the specified format; false for no data format conversion. |
Returns
Type | Description |
---|---|
System.Boolean | An object that contains the data in the specified format, or null if the data is unavailable in the specified format. |
GetDataPresent(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 System.Type object.
Declaration
bool GetDataPresent(Type format)
Parameters
Type | Name | Description |
---|---|---|
System.Type | format | A System.Type that specifies what format to check for. See the System.Windows.DataFormats class for a set of predefined data formats. |
Returns
Type | Description |
---|---|
System.Boolean | True if the data is in, or can be converted to, the specified format; otherwise, false. |
GetFormats()
Returns a list of formats in which the data in this data object is stored, or can be converted to.
Declaration
string[] GetFormats()
Returns
Type | Description |
---|---|
System.String[] | An array of strings, with each string specifying the name of a format that this data object supports. |
GetFormats(Boolean)
Returns a list of formats in which the data in this data object is stored. A flag indicates whether to also include formats that the data can be automatically converted to.
Declaration
string[] GetFormats(bool autoConvert)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | autoConvert | True to attempt to automatically convert the data to the specified format; false for no data format conversion. |
Returns
Type | Description |
---|---|
System.String[] | An array of strings, with each string specifying the name of a format that this data object supports. |
SetData(Object)
Stores the specified data in this data object, automatically determining the data format from the source object type.
Declaration
void SetData(object data)
Parameters
Type | Name | Description |
---|---|---|
System.Object | data | An object that represents the data to store in this data object. |
SetData(String, Object)
Stores the specified data in this data object, automatically determining the data format from the source object type.
Declaration
void SetData(string format, object data)
Parameters
Type | Name | Description |
---|---|---|
System.String | format | A string that specifies the format for the data. |
System.Object | data | An object that represents the data to store in this data object. |
SetData(String, Object, Boolean)
Stores the specified data in this data object, automatically determining the data format from the source object type.
Declaration
void SetData(string format, object data, bool autoConvert)
Parameters
Type | Name | Description |
---|---|---|
System.String | format | A string that specifies the format for the data. |
System.Object | data | An object that represents the data to store in this data object. |
System.Boolean | autoConvert | True to attempt to automatically convert the data to the specified format; false for no data format conversion. |
SetData(Type, Object)
Stores the specified data in this data object, automatically determining the data format from the source object type.
Declaration
void SetData(Type format, object data)
Parameters
Type | Name | Description |
---|---|---|
System.Type | format | A System.Type that specifies the format for the data. |
System.Object | data | An object that represents the data to store in this data object. |