Class MouseEventArgs
- Namespace
- SharpConsoleUI.Events
- Assembly
- SharpConsoleUI.dll
Event arguments for mouse events
public class MouseEventArgs
- Inheritance
-
MouseEventArgs
- Inherited Members
Constructors
MouseEventArgs(List<MouseFlags>, Point, Point, Point, Window?)
Creates a new MouseEventArgs instance
public MouseEventArgs(List<MouseFlags> flags, Point position, Point absolutePosition, Point windowPosition, Window? sourceWindow = null)
Parameters
flagsList<MouseFlags>positionPointabsolutePositionPointwindowPositionPointsourceWindowWindow
Properties
AbsolutePosition
Absolute position in desktop coordinates
public Point AbsolutePosition { get; set; }
Property Value
Flags
Mouse flags indicating the type of mouse event
public List<MouseFlags> Flags { get; set; }
Property Value
Handled
Whether this event has been handled and should not propagate further
public bool Handled { get; set; }
Property Value
Position
Position relative to the control receiving the event
public Point Position { get; set; }
Property Value
SourceWindow
The window that received the mouse event
public Window? SourceWindow { get; set; }
Property Value
WindowPosition
Position relative to the window containing the control
public Point WindowPosition { get; set; }
Property Value
Methods
HasAnyFlag(params MouseFlags[])
Convenience method to check if any of the specified flags are present
public bool HasAnyFlag(params MouseFlags[] flags)
Parameters
flagsMouseFlags[]
Returns
HasFlag(MouseFlags)
Convenience method to check if specific mouse flags are present
public bool HasFlag(MouseFlags flag)
Parameters
flagMouseFlags
Returns
WithFlags(params MouseFlags[])
Creates a copy of this event args with additional flags
public MouseEventArgs WithFlags(params MouseFlags[] additionalFlags)
Parameters
additionalFlagsMouseFlags[]
Returns
WithPosition(Point)
Creates a copy of this event args with a new position (for coordinate translation)
public MouseEventArgs WithPosition(Point newPosition)
Parameters
newPositionPoint
Returns
WithReplacedFlags(params MouseFlags[])
Creates a copy of this event args with flags replaced
public MouseEventArgs WithReplacedFlags(params MouseFlags[] replacementFlags)
Parameters
replacementFlagsMouseFlags[]