Class DragEventDispatchExtensions
- Namespace
- Bunit
- Assembly
- Bunit.Web.dll
Drag event dispatch helper extension methods.
public static class DragEventDispatchExtensions
- Inheritance
-
DragEventDispatchExtensions
- Inherited Members
Methods
Drag(IElement, DragEventArgs)
Raises the @ondrag
event on element
, passing the provided eventArgs
to the event handler.
public static void Drag(this IElement element, DragEventArgs eventArgs)
Parameters
element
IElementThe element to raise the event on.
eventArgs
DragEventArgsThe event arguments to pass to the event handler.
Drag(IElement, long, double, double, double, double, long, long, bool, bool, bool, bool, string, DataTransfer)
Raises the @ondrag
event on element
, passing the provided
properties to the event handler via a DragEventArgs object.
public static void Drag(this IElement element, long detail = 0, double screenX = 0, double screenY = 0, double clientX = 0, double clientY = 0, long button = 0, long buttons = 0, bool ctrlKey = false, bool shiftKey = false, bool altKey = false, bool metaKey = false, string type = null, DataTransfer dataTransfer = null)
Parameters
element
IElementThe element to raise the event on.
detail
longA count of consecutive clicks that happened in a short amount of time, incremented by one.
screenX
doubleThe X coordinate of the mouse pointer in global (screen) coordinates.
screenY
doubleThe Y coordinate of the mouse pointer in global (screen) coordinates.
clientX
doubleThe X coordinate of the mouse pointer in local (DOM content) coordinates.
clientY
doubleThe Y coordinate of the mouse pointer in local (DOM content) coordinates.
button
longThe button number that was pressed when the mouse event was fired: Left button=0, middle button=1 (if present), right button=2. For mice configured for left handed use in which the button actions are reversed the values are instead read from right to left.
buttons
longThe buttons being pressed when the mouse event was fired: Left button=1, Right button=2, Middle (wheel) button=4, 4th button (typically, "Browser Back" button)=8, 5th button (typically, "Browser Forward" button)=16. If two or more buttons are pressed, returns the logical sum of the values. E.g., if Left button and Right button are pressed, returns 3 (=1 | 2).
ctrlKey
booltrue if the control key was down when the event was fired. false otherwise.
shiftKey
booltrue if the shift key was down when the event was fired. false otherwise.
altKey
booltrue if the alt key was down when the event was fired. false otherwise.
metaKey
booltrue if the meta key was down when the event was fired. false otherwise.
type
stringGets or sets the type of the event.
dataTransfer
DataTransferThe data that underlies a drag-and-drop operation, known as the drag data store. See DataTransfer.
DragAsync(IElement, DragEventArgs)
Raises the @ondrag
event on element
, passing the provided eventArgs
to the event handler.
public static Task DragAsync(this IElement element, DragEventArgs eventArgs)
Parameters
element
IElementThe element to raise the event on.
eventArgs
DragEventArgsThe event arguments to pass to the event handler.
Returns
- Task
A task that completes when the event handler is done.
DragEnd(IElement, DragEventArgs)
Raises the @ondragend
event on element
, passing the provided eventArgs
to the event handler.
public static void DragEnd(this IElement element, DragEventArgs eventArgs)
Parameters
element
IElementThe element to raise the event on.
eventArgs
DragEventArgsThe event arguments to pass to the event handler.
DragEnd(IElement, long, double, double, double, double, long, long, bool, bool, bool, bool, string?, DataTransfer?)
Raises the @ondragend
event on element
, passing the provided
properties to the event handler via a DragEventArgs object.
public static void DragEnd(this IElement element, long detail = 0, double screenX = 0, double screenY = 0, double clientX = 0, double clientY = 0, long button = 0, long buttons = 0, bool ctrlKey = false, bool shiftKey = false, bool altKey = false, bool metaKey = false, string? type = null, DataTransfer? dataTransfer = null)
Parameters
element
IElementThe element to raise the event on.
detail
longA count of consecutive clicks that happened in a short amount of time, incremented by one.
screenX
doubleThe X coordinate of the mouse pointer in global (screen) coordinates.
screenY
doubleThe Y coordinate of the mouse pointer in global (screen) coordinates.
clientX
doubleThe X coordinate of the mouse pointer in local (DOM content) coordinates.
clientY
doubleThe Y coordinate of the mouse pointer in local (DOM content) coordinates.
button
longThe button number that was pressed when the mouse event was fired: Left button=0, middle button=1 (if present), right button=2. For mice configured for left handed use in which the button actions are reversed the values are instead read from right to left.
buttons
longThe buttons being pressed when the mouse event was fired: Left button=1, Right button=2, Middle (wheel) button=4, 4th button (typically, "Browser Back" button)=8, 5th button (typically, "Browser Forward" button)=16. If two or more buttons are pressed, returns the logical sum of the values. E.g., if Left button and Right button are pressed, returns 3 (=1 | 2).
ctrlKey
booltrue if the control key was down when the event was fired. false otherwise.
shiftKey
booltrue if the shift key was down when the event was fired. false otherwise.
altKey
booltrue if the alt key was down when the event was fired. false otherwise.
metaKey
booltrue if the meta key was down when the event was fired. false otherwise.
type
stringGets or sets the type of the event.
dataTransfer
DataTransferThe data that underlies a drag-and-drop operation, known as the drag data store. See DataTransfer.
DragEndAsync(IElement, DragEventArgs)
Raises the @ondragend
event on element
, passing the provided eventArgs
to the event handler.
public static Task DragEndAsync(this IElement element, DragEventArgs eventArgs)
Parameters
element
IElementThe element to raise the event on.
eventArgs
DragEventArgsThe event arguments to pass to the event handler.
Returns
- Task
A task that completes when the event handler is done.
DragEnter(IElement, DragEventArgs)
Raises the @ondragenter
event on element
, passing the provided eventArgs
to the event handler.
public static void DragEnter(this IElement element, DragEventArgs eventArgs)
Parameters
element
IElementThe element to raise the event on.
eventArgs
DragEventArgsThe event arguments to pass to the event handler.
DragEnter(IElement, long, double, double, double, double, long, long, bool, bool, bool, bool, string?, DataTransfer?)
Raises the @ondragenter
event on element
, passing the provided
properties to the event handler via a DragEventArgs object.
public static void DragEnter(this IElement element, long detail = 0, double screenX = 0, double screenY = 0, double clientX = 0, double clientY = 0, long button = 0, long buttons = 0, bool ctrlKey = false, bool shiftKey = false, bool altKey = false, bool metaKey = false, string? type = null, DataTransfer? dataTransfer = null)
Parameters
element
IElementThe element to raise the event on.
detail
longA count of consecutive clicks that happened in a short amount of time, incremented by one.
screenX
doubleThe X coordinate of the mouse pointer in global (screen) coordinates.
screenY
doubleThe Y coordinate of the mouse pointer in global (screen) coordinates.
clientX
doubleThe X coordinate of the mouse pointer in local (DOM content) coordinates.
clientY
doubleThe Y coordinate of the mouse pointer in local (DOM content) coordinates.
button
longThe button number that was pressed when the mouse event was fired: Left button=0, middle button=1 (if present), right button=2. For mice configured for left handed use in which the button actions are reversed the values are instead read from right to left.
buttons
longThe buttons being pressed when the mouse event was fired: Left button=1, Right button=2, Middle (wheel) button=4, 4th button (typically, "Browser Back" button)=8, 5th button (typically, "Browser Forward" button)=16. If two or more buttons are pressed, returns the logical sum of the values. E.g., if Left button and Right button are pressed, returns 3 (=1 | 2).
ctrlKey
booltrue if the control key was down when the event was fired. false otherwise.
shiftKey
booltrue if the shift key was down when the event was fired. false otherwise.
altKey
booltrue if the alt key was down when the event was fired. false otherwise.
metaKey
booltrue if the meta key was down when the event was fired. false otherwise.
type
stringGets or sets the type of the event.
dataTransfer
DataTransferThe data that underlies a drag-and-drop operation, known as the drag data store. See DataTransfer.
DragEnterAsync(IElement, DragEventArgs)
Raises the @ondragenter
event on element
, passing the provided eventArgs
to the event handler.
public static Task DragEnterAsync(this IElement element, DragEventArgs eventArgs)
Parameters
element
IElementThe element to raise the event on.
eventArgs
DragEventArgsThe event arguments to pass to the event handler.
Returns
- Task
A task that completes when the event handler is done.
DragLeave(IElement, DragEventArgs)
Raises the @ondragleave
event on element
, passing the provided eventArgs
to the event handler.
public static void DragLeave(this IElement element, DragEventArgs eventArgs)
Parameters
element
IElementThe element to raise the event on.
eventArgs
DragEventArgsThe event arguments to pass to the event handler.
DragLeave(IElement, long, double, double, double, double, long, long, bool, bool, bool, bool, string?, DataTransfer?)
Raises the @ondragleave
event on element
, passing the provided
properties to the event handler via a DragEventArgs object.
public static void DragLeave(this IElement element, long detail = 0, double screenX = 0, double screenY = 0, double clientX = 0, double clientY = 0, long button = 0, long buttons = 0, bool ctrlKey = false, bool shiftKey = false, bool altKey = false, bool metaKey = false, string? type = null, DataTransfer? dataTransfer = null)
Parameters
element
IElementThe element to raise the event on.
detail
longA count of consecutive clicks that happened in a short amount of time, incremented by one.
screenX
doubleThe X coordinate of the mouse pointer in global (screen) coordinates.
screenY
doubleThe Y coordinate of the mouse pointer in global (screen) coordinates.
clientX
doubleThe X coordinate of the mouse pointer in local (DOM content) coordinates.
clientY
doubleThe Y coordinate of the mouse pointer in local (DOM content) coordinates.
button
longThe button number that was pressed when the mouse event was fired: Left button=0, middle button=1 (if present), right button=2. For mice configured for left handed use in which the button actions are reversed the values are instead read from right to left.
buttons
longThe buttons being pressed when the mouse event was fired: Left button=1, Right button=2, Middle (wheel) button=4, 4th button (typically, "Browser Back" button)=8, 5th button (typically, "Browser Forward" button)=16. If two or more buttons are pressed, returns the logical sum of the values. E.g., if Left button and Right button are pressed, returns 3 (=1 | 2).
ctrlKey
booltrue if the control key was down when the event was fired. false otherwise.
shiftKey
booltrue if the shift key was down when the event was fired. false otherwise.
altKey
booltrue if the alt key was down when the event was fired. false otherwise.
metaKey
booltrue if the meta key was down when the event was fired. false otherwise.
type
stringGets or sets the type of the event.
dataTransfer
DataTransferThe data that underlies a drag-and-drop operation, known as the drag data store. See DataTransfer.
DragLeaveAsync(IElement, DragEventArgs)
Raises the @ondragleave
event on element
, passing the provided eventArgs
to the event handler.
public static Task DragLeaveAsync(this IElement element, DragEventArgs eventArgs)
Parameters
element
IElementThe element to raise the event on.
eventArgs
DragEventArgsThe event arguments to pass to the event handler.
Returns
- Task
A task that completes when the event handler is done.
DragOver(IElement, DragEventArgs)
Raises the @ondragover
event on element
, passing the provided eventArgs
to the event handler.
public static void DragOver(this IElement element, DragEventArgs eventArgs)
Parameters
element
IElementThe element to raise the event on.
eventArgs
DragEventArgsThe event arguments to pass to the event handler.
DragOver(IElement, long, double, double, double, double, long, long, bool, bool, bool, bool, string?, DataTransfer?)
Raises the @ondragover
event on element
, passing the provided
properties to the event handler via a DragEventArgs object.
public static void DragOver(this IElement element, long detail = 0, double screenX = 0, double screenY = 0, double clientX = 0, double clientY = 0, long button = 0, long buttons = 0, bool ctrlKey = false, bool shiftKey = false, bool altKey = false, bool metaKey = false, string? type = null, DataTransfer? dataTransfer = null)
Parameters
element
IElementThe element to raise the event on.
detail
longA count of consecutive clicks that happened in a short amount of time, incremented by one.
screenX
doubleThe X coordinate of the mouse pointer in global (screen) coordinates.
screenY
doubleThe Y coordinate of the mouse pointer in global (screen) coordinates.
clientX
doubleThe X coordinate of the mouse pointer in local (DOM content) coordinates.
clientY
doubleThe Y coordinate of the mouse pointer in local (DOM content) coordinates.
button
longThe button number that was pressed when the mouse event was fired: Left button=0, middle button=1 (if present), right button=2. For mice configured for left handed use in which the button actions are reversed the values are instead read from right to left.
buttons
longThe buttons being pressed when the mouse event was fired: Left button=1, Right button=2, Middle (wheel) button=4, 4th button (typically, "Browser Back" button)=8, 5th button (typically, "Browser Forward" button)=16. If two or more buttons are pressed, returns the logical sum of the values. E.g., if Left button and Right button are pressed, returns 3 (=1 | 2).
ctrlKey
booltrue if the control key was down when the event was fired. false otherwise.
shiftKey
booltrue if the shift key was down when the event was fired. false otherwise.
altKey
booltrue if the alt key was down when the event was fired. false otherwise.
metaKey
booltrue if the meta key was down when the event was fired. false otherwise.
type
stringGets or sets the type of the event.
dataTransfer
DataTransferThe data that underlies a drag-and-drop operation, known as the drag data store. See DataTransfer.
DragOverAsync(IElement, DragEventArgs)
Raises the @ondragover
event on element
, passing the provided eventArgs
to the event handler.
public static Task DragOverAsync(this IElement element, DragEventArgs eventArgs)
Parameters
element
IElementThe element to raise the event on.
eventArgs
DragEventArgsThe event arguments to pass to the event handler.
Returns
- Task
A task that completes when the event handler is done.
DragStart(IElement, DragEventArgs)
Raises the @ondragstart
event on element
, passing the provided eventArgs
to the event handler.
public static void DragStart(this IElement element, DragEventArgs eventArgs)
Parameters
element
IElementThe element to raise the event on.
eventArgs
DragEventArgsThe event arguments to pass to the event handler.
DragStart(IElement, long, double, double, double, double, long, long, bool, bool, bool, bool, string?, DataTransfer?)
Raises the @ondragstart
event on element
, passing the provided
properties to the event handler via a DragEventArgs object.
public static void DragStart(this IElement element, long detail = 0, double screenX = 0, double screenY = 0, double clientX = 0, double clientY = 0, long button = 0, long buttons = 0, bool ctrlKey = false, bool shiftKey = false, bool altKey = false, bool metaKey = false, string? type = null, DataTransfer? dataTransfer = null)
Parameters
element
IElementThe element to raise the event on.
detail
longA count of consecutive clicks that happened in a short amount of time, incremented by one.
screenX
doubleThe X coordinate of the mouse pointer in global (screen) coordinates.
screenY
doubleThe Y coordinate of the mouse pointer in global (screen) coordinates.
clientX
doubleThe X coordinate of the mouse pointer in local (DOM content) coordinates.
clientY
doubleThe Y coordinate of the mouse pointer in local (DOM content) coordinates.
button
longThe button number that was pressed when the mouse event was fired: Left button=0, middle button=1 (if present), right button=2. For mice configured for left handed use in which the button actions are reversed the values are instead read from right to left.
buttons
longThe buttons being pressed when the mouse event was fired: Left button=1, Right button=2, Middle (wheel) button=4, 4th button (typically, "Browser Back" button)=8, 5th button (typically, "Browser Forward" button)=16. If two or more buttons are pressed, returns the logical sum of the values. E.g., if Left button and Right button are pressed, returns 3 (=1 | 2).
ctrlKey
booltrue if the control key was down when the event was fired. false otherwise.
shiftKey
booltrue if the shift key was down when the event was fired. false otherwise.
altKey
booltrue if the alt key was down when the event was fired. false otherwise.
metaKey
booltrue if the meta key was down when the event was fired. false otherwise.
type
stringGets or sets the type of the event.
dataTransfer
DataTransferThe data that underlies a drag-and-drop operation, known as the drag data store. See DataTransfer.
DragStartAsync(IElement, DragEventArgs)
Raises the @ondragstart
event on element
, passing the provided eventArgs
to the event handler.
public static Task DragStartAsync(this IElement element, DragEventArgs eventArgs)
Parameters
element
IElementThe element to raise the event on.
eventArgs
DragEventArgsThe event arguments to pass to the event handler.
Returns
- Task
A task that completes when the event handler is done.
Drop(IElement, DragEventArgs)
Raises the @ondrop
event on element
, passing the provided eventArgs
to the event handler.
public static void Drop(this IElement element, DragEventArgs eventArgs)
Parameters
element
IElementThe element to raise the event on.
eventArgs
DragEventArgsThe event arguments to pass to the event handler.
Drop(IElement, long, double, double, double, double, long, long, bool, bool, bool, bool, string?, DataTransfer?)
Raises the @ondrop
event on element
, passing the provided
properties to the event handler via a DragEventArgs object.
public static void Drop(this IElement element, long detail = 0, double screenX = 0, double screenY = 0, double clientX = 0, double clientY = 0, long button = 0, long buttons = 0, bool ctrlKey = false, bool shiftKey = false, bool altKey = false, bool metaKey = false, string? type = null, DataTransfer? dataTransfer = null)
Parameters
element
IElementThe element to raise the event on.
detail
longA count of consecutive clicks that happened in a short amount of time, incremented by one.
screenX
doubleThe X coordinate of the mouse pointer in global (screen) coordinates.
screenY
doubleThe Y coordinate of the mouse pointer in global (screen) coordinates.
clientX
doubleThe X coordinate of the mouse pointer in local (DOM content) coordinates.
clientY
doubleThe Y coordinate of the mouse pointer in local (DOM content) coordinates.
button
longThe button number that was pressed when the mouse event was fired: Left button=0, middle button=1 (if present), right button=2. For mice configured for left handed use in which the button actions are reversed the values are instead read from right to left.
buttons
longThe buttons being pressed when the mouse event was fired: Left button=1, Right button=2, Middle (wheel) button=4, 4th button (typically, "Browser Back" button)=8, 5th button (typically, "Browser Forward" button)=16. If two or more buttons are pressed, returns the logical sum of the values. E.g., if Left button and Right button are pressed, returns 3 (=1 | 2).
ctrlKey
booltrue if the control key was down when the event was fired. false otherwise.
shiftKey
booltrue if the shift key was down when the event was fired. false otherwise.
altKey
booltrue if the alt key was down when the event was fired. false otherwise.
metaKey
booltrue if the meta key was down when the event was fired. false otherwise.
type
stringGets or sets the type of the event.
dataTransfer
DataTransferThe data that underlies a drag-and-drop operation, known as the drag data store. See DataTransfer.
DropAsync(IElement, DragEventArgs)
Raises the @ondrop
event on element
, passing the provided eventArgs
to the event handler.
public static Task DropAsync(this IElement element, DragEventArgs eventArgs)
Parameters
element
IElementThe element to raise the event on.
eventArgs
DragEventArgsThe event arguments to pass to the event handler.
Returns
- Task
A task that completes when the event handler is done.