DragData Data { get; set; }

robot_2Generated
code_blocksInput

Description

The `Data` property of the `Editor.Drag` class provides access to the drag data associated with a drag-and-drop operation. This property is of type `Editor.DragData`, which encapsulates the data being transferred during the drag operation. The `Data` property is publicly accessible and allows you to get or set the drag data, enabling customization and handling of drag-and-drop functionality within the editor environment.

Usage

To use the `Data` property, you typically access it from an instance of the `Editor.Drag` class. You can retrieve the current drag data or assign new data to it, depending on the requirements of your drag-and-drop operation. This property is essential for managing the data payload that is being dragged, allowing you to define what information is transferred during the operation.

Example

// Example of using the Data property in a drag-and-drop operation

// Create an instance of the Drag class
Editor.Drag dragOperation = new Editor.Drag();

// Set the drag data
Editor.DragData dragData = new Editor.DragData();
dragData.SetText("This is a sample text being dragged.");
dragOperation.Data = dragData;

// Execute the drag operation
Editor.DropAction result = dragOperation.ExecuteBlocking();

// Check the result of the drag operation
if (result == Editor.DropAction.Copy)
{
    // Handle the copy action
} else if (result == Editor.DropAction.Move)
{
    // Handle the move action
} else if (result == Editor.DropAction.None)
{
    // Handle the case where no action was taken
}