Export (0) Print
Expand All

IDataObject.GetDataPresent Method (String, Boolean)

Checks whether the data is available in, or can be converted to, a specified format. If the data is not already available in the specified format, a Boolean flag indicates whether to check if the data can be converted to the specified format.

Namespace:  System.Windows
Assembly:  System.Windows (in System.Windows.dll)

bool GetDataPresent(
	string format,
	bool autoConvert
)

Parameters

format
Type: System.String
A string that specifies the format to check for. See the DataFormats class for a set of predefined data formats.
autoConvert
Type: System.Boolean
false to only check for the specified format; true to also check whether the data that is stored in this data object can be converted to the specified format.

Return Value

Type: System.Boolean
true if the data is in, or can be converted to, the specified format; otherwise, false.

This method returns true if either of the following applies:

  • The autoConvert parameter is true, and the data is in the specified format or it can be converted to the specified format.

  • The autoConvert parameter is false, and the data is in the specified format.

This method returns false if either of the following applies:

  • The autoConvert parameter is true, and the data is not available in the specified format and cannot be converted to the specified format.

  • The autoConvert parameter is false, and the data is not available in the specified format.

Silverlight

Supported in: 5, 4

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2015 Microsoft