DataObject.GetData Method (String)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Returns data in a format specified by a string.

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

abstract GetData : 
        format:string -> Object
override GetData : 
        format:string -> Object

Parameters

format
Type: System.String

A string that specifies the format for the data. For a set of predefined data formats, see the DataFormats class.

Return Value

Type: System.Object

An object that contains the data in the specified format, or null if the data is unavailable in the specified format.

Exception Condition
ArgumentNullException

format is null.

The following example uses this method to first check whether a specified data format is available (natively or by auto-convert); if the specified format is available, the example retrieves the data by using the GetData(String) method.

No code example is currently available or this language may not be supported.

The following example code uses the GetDataPresent(String, Boolean) method to first check if a specified data format is available natively (auto-convertible data formats are filtered); if the specified format is available, the example retrieves the data by using the GetData(String) method.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 3.0
Silverlight
Available since 4.0
Return to top
Show: