編集

次の方法で共有


IDataObject.GetDataPresent Method

Definition

Checks to see whether the data is available in, or can be converted to, a specified format.

Overloads

GetDataPresent(String)

Checks to see whether the data is available in, or can be converted to, a specified format; the data format is specified by a string.

GetDataPresent(Type)

Checks to see whether the data is available in, or can be converted to, a specified format. The data format is specified by a Type object.

GetDataPresent(String, Boolean)

Checks to see whether the data is available in, or can be converted to, a specified format. A Boolean flag indicates whether to check if the data can be converted to the specified format, if it is not available in that format.

Remarks

Call GetDataPresent to determine whether a specified format is available in this data object before calling GetData.

Call GetFormats to obtain a list of all the formats that are available in this data object.

GetDataPresent(String)

Checks to see whether the data is available in, or can be converted to, a specified format; the data format is specified by a string.

public:
 bool GetDataPresent(System::String ^ format);
[System.Security.SecurityCritical]
public bool GetDataPresent (string format);
public bool GetDataPresent (string format);
[<System.Security.SecurityCritical>]
abstract member GetDataPresent : string -> bool
abstract member GetDataPresent : string -> bool
Public Function GetDataPresent (format As String) As Boolean

Parameters

format
String

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

Returns

true if the data is in, or can be converted to, the specified format; otherwise, false.

Attributes

Remarks

For an implementation of this method, see GetDataPresent.

Call GetDataPresent to determine whether a specified format is available in this data object before calling GetData.

Call GetFormats to obtain a list of all the formats that are available in this data object.

See also

Applies to

GetDataPresent(Type)

Checks to see whether the data is available in, or can be converted to, a specified format. The data format is specified by a Type object.

public:
 bool GetDataPresent(Type ^ format);
[System.Security.SecurityCritical]
public bool GetDataPresent (Type format);
public bool GetDataPresent (Type format);
[<System.Security.SecurityCritical>]
abstract member GetDataPresent : Type -> bool
abstract member GetDataPresent : Type -> bool
Public Function GetDataPresent (format As Type) As Boolean

Parameters

format
Type

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

Returns

true if the data is in, or can be converted to, the specified format; otherwise, false.

Attributes

Remarks

For an implementation of this method, GetDataPresent.

Call GetDataPresent to determine whether a specified format is available in this data object before calling GetData.

Call GetFormats to obtain a list of all the formats that are available in this data object.

See also

Applies to

GetDataPresent(String, Boolean)

Checks to see whether the data is available in, or can be converted to, a specified format. A Boolean flag indicates whether to check if the data can be converted to the specified format, if it is not available in that format.

public:
 bool GetDataPresent(System::String ^ format, bool autoConvert);
[System.Security.SecurityCritical]
public bool GetDataPresent (string format, bool autoConvert);
public bool GetDataPresent (string format, bool autoConvert);
[<System.Security.SecurityCritical>]
abstract member GetDataPresent : string * bool -> bool
abstract member GetDataPresent : string * bool -> bool
Public Function GetDataPresent (format As String, autoConvert As Boolean) As Boolean

Parameters

format
String

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

autoConvert
Boolean

false to only check for the specified format; true to also check whether or not data stored in this data object can be converted to the specified format.

Returns

true if the data is in, or can be converted to, the specified format; otherwise, false.

Attributes

Remarks

For an implementation of this method, see GetDataPresent.

Call GetDataPresent to determine whether a specified format is available in this data object before calling GetData.

Call GetFormats to obtain a list of all the formats that are available in this data object.

This method returns true when:

  • The autoConvert parameter is true and the data is in the specified format, or it can be converted to the specified format.

  • The autoConvert parameter is false and the data is in the specified format.

This method returns false when:

  • The autoConvert parameter is true and the data is not available in the specified format and cannot be converted to the specified format.

  • The autoConvert parameter is false, and the data is not available in the specified format.

See also

Applies to