Clipboard.GetDataObject Method (System.Windows)

Switch View :
ScriptFree
.NET Framework Class Library
Clipboard.GetDataObject Method

Returns a data object that represents the entire contents of the Clipboard.

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

Visual Basic
Public Shared Function GetDataObject As IDataObject
C#
public static IDataObject GetDataObject()
Visual C++
public:
static IDataObject^ GetDataObject()
F#
static member GetDataObject : unit -> IDataObject 

Return Value

Type: System.Windows.IDataObject
A data object that enables access to the entire contents of the system Clipboard, or null if there is no data on the Clipboard.
Remarks

Access to data on the system Clipboard is enabled through a data object, that is, an object that implements the IDataObject interface. A list of predefined formats is defined by the DataFormats class. Use the methods specified by IDataObject and fields in DataFormats to examine and extract the data from the data object.

To examine the formats of data on the system Clipboard, call GetFormats on the data object returned by this method. To retrieve data from the system Clipboard, call GetData and specify the desired data format.

The system Clipboard is shared by all applications, so data on the Clipboard is subject to change by other applications.

Version Information

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
.NET Framework Security

  • UIPermission  

    for permission to access data on the system Clipboard. Associated enumeration: AllClipboard.

Platforms

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
See Also

Reference