IEnumerable<T> OfType()

robot_2Generated
code_blocksInput

Description

The OfType<T> method in the Editor.DragData class is used to filter the drag data items to only those of a specified type T. This method returns an IEnumerable<T> containing all elements of the specified type from the drag data.

Usage

To use the OfType<T> method, call it on an instance of Editor.DragData. This method does not take any parameters and returns a collection of items of type T that are present in the drag data.

Example

// Example usage of the OfType<T> method
Editor.DragData dragData = new Editor.DragData();

// Assuming dragData contains various types of objects
var specificTypeItems = dragData.OfType<MyType>();

foreach (var item in specificTypeItems)
{
    // Process each item of type MyType
    Console.WriteLine(item);
}