DataObject.SetData Method (String, Object)

 

Stores the specified data in this data object, along with one or more specified data formats; the data format is specified by a string.

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

[SecurityCriticalAttribute]
public void SetData(
	string format,
	object data
)

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.

data
Type: System.Object

An object that represents the data to store in this data object.

Exception Condition
ArgumentNullException

data or format is null.

This method adds data with auto-conversion enabled (the same as calling SetData(String, Object, Boolean) with autoConvert set to true).

UIPermission

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

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