Interface IDataObject
Provides a format-independent mechanism for transferring data.
Namespace: Microsoft.Windows
Assembly: OpenSilver.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(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. |
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. |
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. The data format is specified by a string.
Declaration
void SetData(string format, object data)
Parameters
Type | Name | Description |
---|---|---|
System.String | format | A string that specifies what format to store the data in. |
System.Object | data | The data to store in this data object. |