Description
The Object
property of the Editor.DragData
class is used to store an object that can be utilized to pass drag and drop data within the editor environment. This property is part of the drag and drop functionality, allowing developers to attach any object to a drag event, which can then be accessed when the drag operation is completed or processed.
Usage
To use the Object
property, you can set it with any object you wish to pass during a drag and drop operation. This can be useful for transferring complex data structures or references between different parts of the editor.
Example usage:
var dragData = new Editor.DragData();
dragData.Object = myCustomObject; // Assign your custom object to the drag data
// Later, when handling the drop event
var receivedObject = dragData.Object; // Retrieve the object from the drag data
Example
// Example of setting and retrieving the Object property in a drag and drop operation
// Create a new instance of DragData
Editor.DragData dragData = new Editor.DragData();
// Assign an object to the drag data
MyCustomType myCustomObject = new MyCustomType();
dragData.Object = myCustomObject;
// Later, when handling the drop event
MyCustomType receivedObject = (MyCustomType)dragData.Object;
// Use the received object as needed