IDataObject.SetData Method

Definition

Stores the specified data in this data object.

Overloads

SetData(Object)

Stores the specified data in this data object, automatically converting the data format from the source object type.

SetData(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.

SetData(Type, Object)

Stores the specified data in this data object, along with one or more specified data formats. The data format is specified by a Type class.

SetData(String, Object, Boolean)

Stores the specified data in this data object, along with one or more specified data formats. This overload includes a Boolean flag to indicate whether the data may be converted to another format on retrieval.

SetData(Object)

Stores the specified data in this data object, automatically converting the data format from the source object type.

public:
 void SetData(System::Object ^ data);
[System.Security.SecurityCritical]
public void SetData (object data);
public void SetData (object data);
[<System.Security.SecurityCritical>]
abstract member SetData : obj -> unit
abstract member SetData : obj -> unit
Public Sub SetData (data As Object)

Parameters

data
Object

The data to store in this data object.

Attributes

Remarks

For an implementation of this method, see SetData.

Applies to

SetData(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.

public:
 void SetData(System::String ^ format, System::Object ^ data);
[System.Security.SecurityCritical]
public void SetData (string format, object data);
public void SetData (string format, object data);
[<System.Security.SecurityCritical>]
abstract member SetData : string * obj -> unit
abstract member SetData : string * obj -> unit
Public Sub SetData (format As String, data As Object)

Parameters

format
String

A string that specifies what format to store the data in. See the DataFormats class for a set of pre-defined data formats.

data
Object

The data to store in this data object.

Attributes

Remarks

For an implementation of this method, see SetData.

Applies to

SetData(Type, Object)

Stores the specified data in this data object, along with one or more specified data formats. The data format is specified by a Type class.

public:
 void SetData(Type ^ format, System::Object ^ data);
[System.Security.SecurityCritical]
public void SetData (Type format, object data);
public void SetData (Type format, object data);
[<System.Security.SecurityCritical>]
abstract member SetData : Type * obj -> unit
abstract member SetData : Type * obj -> unit
Public Sub SetData (format As Type, data As Object)

Parameters

format
Type

A Type that specifies what format to store the data in. See the DataFormats class for a set of predefined data formats.

data
Object

The data to store in this data object.

Attributes

Remarks

For an implementation of this method, see SetData.

Applies to

SetData(String, Object, Boolean)

Stores the specified data in this data object, along with one or more specified data formats. This overload includes a Boolean flag to indicate whether the data may be converted to another format on retrieval.

public:
 void SetData(System::String ^ format, System::Object ^ data, bool autoConvert);
[System.Security.SecurityCritical]
public void SetData (string format, object data, bool autoConvert);
public void SetData (string format, object data, bool autoConvert);
[<System.Security.SecurityCritical>]
abstract member SetData : string * obj * bool -> unit
abstract member SetData : string * obj * bool -> unit
Public Sub SetData (format As String, data As Object, autoConvert As Boolean)

Parameters

format
String

A string that specifies what format to store the data in. See the DataFormats class for a set of pre-defined data formats.

data
Object

The data to store in this data object.

autoConvert
Boolean

true to allow the data to be converted to another format on retrieval; false to prohibit the data from being converted to another format on retrieval.

Attributes

Remarks

For an implementation of this method, see SetData.

Applies to