DataObjectPastingEventArgs(IDataObject, Boolean, String) Constructor

Definition

Initializes a new instance of DataObjectPastingEventArgs.

public DataObjectPastingEventArgs (System.Windows.IDataObject dataObject, bool isDragDrop, string formatToApply);

Parameters

dataObject
IDataObject

A DataObject containing the data to be pasted.

isDragDrop
Boolean

A Boolean value indicating whether the paste is part of a drag-and-drop operation. true to indicate that the paste is part of a drag-and-drop operation; otherwise, false. If this parameter is set to true, a Pasting event is fired on drop.

formatToApply
String

A string specifying the preferred data format to use for the paste operation. See the DataFormats class for a set of predefined data formats.

Exceptions

Raised when dataObject or formatToApply is null.

Raised when formatToApply specifies a data format that is not present in the data object specified by dataObject.

Remarks

A DataObjectPastingEventArgs object is typically created by the application that is initiating the paste operation.

Applies to

Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9