Class DataObject
Provides a basic implementation of the IDataObject interface, which defines a format-independent mechanism for transferring data.
Inheritance
Implements
Inherited Members
Namespace: Microsoft.Windows
Assembly: OpenSilver.dll
Syntax
public sealed class DataObject : IDataObject
Constructors
| Improve this Doc View SourceDataObject()
Declaration
public DataObject()
Methods
| Improve this Doc View SourceGetData(String)
Retrieves a data object in a specified format; the data format is specified by a string.
Declaration
public 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 that has the data in the specified format, or null if the data is not available in the specified format. |
GetData(Type)
Declaration
public object GetData(Type format)
Parameters
Type | Name | Description |
---|---|---|
System.Type | format |
Returns
Type | Description |
---|---|
System.Object |
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
public bool GetDataPresent(string format)
Parameters
Type | Name | Description |
---|---|---|
System.String | format | A string that specifies the 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 all formats that the data in this data object is stored in, or can be converted to.
Declaration
public string[] GetFormats()
Returns
Type | Description |
---|---|
System.String[] | An array of strings, with each string specifying the name of a format supported by this data object. |
SetData(Object)
Stores the specified data in this data object, automatically determining the data format from the source object type.
Declaration
public void SetData(object data)
Parameters
Type | Name | Description |
---|---|---|
System.Object | data | 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
public 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. |