DataObject.ContainsText Method (TextDataFormat)


Queries a data object for the presence of data in a text data format.

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

public bool ContainsText(
	TextDataFormat format


Type: System.Windows.TextDataFormat

A member of the TextDataFormat enumeration that specifies the text data format to query for.

Return Value

Type: System.Boolean

true if the data object contains data in a text data format; otherwise, false.

Exception Condition

format does not specify a valid member of TextDataFormat.

This method returns true only if the specified data format exists natively in the data object; this method does not check for the presence of auto-convertible data formats.

.NET Framework
Available since 3.0
Return to top