Syncfusion.Shared.Base
Members 


Syncfusion.Windows.Forms Namespace : MouseControllerDispatcher Class

MouseControllerDispatcher Class

MouseControllerDispatcher coordinates mouse events among competing mouse controllers. Based on the position of the mouse and context of the control every registered controller's HitTest method is called to determine the best controller for the following mouse action. This controller will then receive mouse events.
Syntax
'Declaration
 
Public Class MouseControllerDispatcher 
   Inherits Syncfusion.ComponentModel.NonFinalizeDisposable
'Usage
 
Dim instance As MouseControllerDispatcher
public class MouseControllerDispatcher : Syncfusion.ComponentModel.NonFinalizeDisposable 
Remarks
Any Mouse Controller needs to implement the IMouseController interface.

In its implementation of MouseController.HitTest, the mouse controller should determine whether your controller wants to handle the mouse events based current context.

MouseControllerDispatcher will call HitTest for each Mouse Controller that has been registered with Add(IMouseController). The Mouse Controller that wins the vote will receive all Mouse hovering events like MouseHoverEnter, MouseHover and MouseHoverLeave as long as its HitTest method indicates that it wants to handle the mouse event. A MouseHoverLeave notification is guaranteed after MouseHoverEnter has been called.

When the user presses the mouse, a MouseDown will be sent to the controller. All subsequent mouse events will then go to that specific controller until the user releases the mouse or the mouse operations is cancelled. A call to either MouseUp or CancelMode is guaranteed after a controller MouseDown method was called.

Mouse controllers are registered by calling the Add method.

If the control that MouseControllerDispatcher should be associated with is derived from ScrollControl, you should use ScrollControllMouseControllerDispatcher because it will automatically hook itself up with mouse events from ScrollControl.

Otherwise if you want to attach MouseControllerDispatcher to a different type of Control, you need to delegate mouse events to MouseControllerDispatcher. MouseControllerDispatcher provides ProcessXYZ methods for every mouse event that should be forwarded. Simply call these methods from your mouse event handlers in your control.

Inheritance Hierarchy

System.Object
   Syncfusion.ComponentModel.NonFinalizeDisposable
      Syncfusion.Windows.Forms.MouseControllerDispatcher
         Syncfusion.Windows.Forms.ScrollControllMouseControllerDispatcher

AssemblyVersion

Syncfusion.Shared.Base: 17.3460.0.26

See Also