Class DragHelper<T, U>
Base class for drag and drop operation helpers.
Inheritance
Namespace: FlaxEditor.GUI.Drag
Assembly: FlaxEngine.CSharp.dll
Syntax
public abstract class DragHelper<T, U> : DragHelper where U : DragEventArgs
Type Parameters
T
Type of the objects to collect from drag data. |
U
Type of the drag-drop event. |
Constructors
DragHelper(Func<T, Boolean>)
Creates a new DragHelper
Declaration
protected DragHelper(Func<T, bool> validateFunction)
Parameters
System.Func<T, System.Boolean>
validateFunction
The validation function |
Fields
Objects
The objects gathered.
Declaration
public readonly List<T> Objects
Field Value
System.Collections.Generic.List<T>
|
Properties
Effect
Gets the current drag effect.
Declaration
public override DragDropEffect Effect { get; }
Property Value
DragDropEffect
|
Overrides
HasValidDrag
Gets a value indicating whether this instance has valid drag data.
Declaration
public sealed override bool HasValidDrag { get; }
Property Value
System.Boolean
|
Overrides
ValidateFunction
The validation function
Declaration
protected Func<T, bool> ValidateFunction { get; set; }
Property Value
System.Func<T, System.Boolean>
|
Methods
DragDrop(U, IEnumerable<T>)
Handler drag drop event.
Declaration
public virtual void DragDrop(U dragEventArgs, IEnumerable<T> item)
Parameters
U
dragEventArgs
The drag event arguments. |
System.Collections.Generic.IEnumerable<T>
item
The item. |
FromDragData(DragData)
Tries to parse the drag data.
Declaration
public abstract IEnumerable<T> FromDragData(DragData data)
Parameters
DragData
data
The data. |
Returns
System.Collections.Generic.IEnumerable<T>
Gathered objects or empty IEnumerable if cannot get any valid. |
InvalidDrag()
Invalids the drag data.
Declaration
public void InvalidDrag()
OnDragDrop()
Called when drag drops.
Declaration
public sealed override void OnDragDrop()
Overrides
OnDragDrop(DragEventArgs)
Called when drag drops.
Declaration
public sealed override void OnDragDrop(DragEventArgs dragEventArgs)
Parameters
DragEventArgs
dragEventArgs
Arguments |
Overrides
OnDragEnter(DragData)
Called when drag enters.
Declaration
public sealed override bool OnDragEnter(DragData data)
Parameters
DragData
data
The data. |
Returns
System.Boolean
True if drag event is valid and can be performed, otherwise false. |
Overrides
OnDragLeave()
Called when drag leaves.
Declaration
public override void OnDragLeave()
Overrides
ToDragData(T)
Gets the drag data.
Declaration
public abstract DragData ToDragData(T item)
Parameters
T
item
An item. |
Returns
DragData
The data. |
ToDragData(IEnumerable<T>)
Gets the drag data.
Declaration
public abstract DragData ToDragData(IEnumerable<T> items)
Parameters
System.Collections.Generic.IEnumerable<T>
items
The items. |
Returns
DragData
The data. |