protected virtual void OnLostMouseFocus(UIMouseEventArgs e) { if (this.evhMouseLostFocus != null) { this.evhMouseLostFocus(e); } }
protected override void OnMouseDown(UIMouseEventArgs e) { ////test only!!! this.lastX = e.X; this.lastY = e.Y; pointList.Add(new Point(lastX, lastY)); }
void IEventPortal.PortalMouseUp(UIMouseEventArgs e) { //find hit svg graphics.... SvgHitChain hitChain = GetFreeHitChain(); hitChain.SetRootGlobalPosition(e.X, e.Y); //1. hit test HitTestCore(this.SvgRoot.SvgSpec, hitChain, e.X, e.Y); SetEventOrigin(e, hitChain); //2. propagate event portal ForEachOnlyEventPortalBubbleUp(e, hitChain, (portal) => { portal.PortalMouseUp(e); return true; }); if (!e.CancelBubbling) { //2. propagate events ForEachEventListenerBubbleUp(e, hitChain, () => { e.CurrentContextElement.ListenMouseUp(e); return true; }); } e.CancelBubbling = true; ReleaseHitChain(hitChain); }
void IEventPortal.PortalMouseDown(UIMouseEventArgs e) { //find hit svg graphics.... SvgHitChain hitChain = GetFreeHitChain(); hitChain.SetRootGlobalPosition(e.X, e.Y); //1. hit test HitTestCore(this.SvgRoot.SvgSpec, hitChain, e.X, e.Y); SetEventOrigin(e, hitChain); //2. propagate event portal ForEachOnlyEventPortalBubbleUp(e, hitChain, (portal) => { portal.PortalMouseDown(e); return true; }); if (!e.CancelBubbling) { //2. propagate events ForEachSvgElementBubbleUp(e, hitChain, () => { //------- //temp test only //------- var svgElement = e.ExactHitObject as SvgElement; if (svgElement is SvgRect) { ((SvgRect)svgElement).FillColor = Color.White; } return true; }); } e.CancelBubbling = true; ReleaseHitChain(hitChain); }
//---------------------------------------------------- protected override void OnMouseDown(UIMouseEventArgs e) { if (this.MouseDown != null) { this.MouseDown(this, e); } }
protected virtual void OnMouseDown(UIMouseEventArgs e) { if (this.evhMouseDown != null) { evhMouseDown(e); } }
protected override void OnMouseUp(UIMouseEventArgs e) { if (this.MouseUp != null) { MouseUp(this, e); } base.OnMouseUp(e); }
void panel_MouseDoubleClick(object sender, UIMouseEventArgs e) { //raise event mouse double click var src = e.SourceHitElement as ListItem; if (src != null && ListItemMouseEvent != null) { e.UIEventName = UIEventName.DblClick; ListItemMouseEvent(this, e); } }
public void MouseDown(UIMouseEventArgs e, CssBox startAt) { if (!_isBinded) return; if (startAt == null) return; //---------------------------------------------------- ClearPreviousSelection(); if (_latestMouseDownChain != null) { ReleaseHitChain(_latestMouseDownChain); _latestMouseDownChain = null; } this.lastDomLayoutVersion = this._htmlContainer.LayoutVersion; //---------------------------------------------------- int x = e.X; int y = e.Y; this._mouseDownStartAt = startAt; this._mousedownX = x; this._mousedownY = y; CssBoxHitChain hitChain = GetFreeHitChain(); hitChain.SetRootGlobalPosition(x, y); //1. hittest BoxHitUtils.HitTest(startAt, x, y, hitChain); //2. propagate events SetEventOrigin(e, hitChain); ForEachOnlyEventPortalBubbleUp(e, hitChain, (portal) => { portal.PortalMouseDown(e); return true; }); if (!e.CancelBubbling) { var prevMouseDownElement = this.currentMouseDown; e.CurrentContextElement = this.currentMouseDown = null; //clear ForEachEventListenerBubbleUp(e, hitChain, () => { //TODO: check accept keyboard this.currentMouseDown = e.CurrentContextElement; e.CurrentContextElement.ListenMouseDown(e); if (prevMouseDownElement != null && prevMouseDownElement != currentMouseDown) { prevMouseDownElement.ListenLostMouseFocus(e); } return e.CancelBubbling; }); } //---------------------------------- //save mousedown hitchain this._latestMouseDownChain = hitChain; }
static void MoveWithSnapToGrid(UIControllerBox controllerBox, UIMouseEventArgs e) { //sample move with snap to grid Point pos = controllerBox.Position; int newX = pos.X + e.XDiff; int newY = pos.Y + e.YDiff; //snap to gridsize =5; //find nearest snap x int gridSize = 5; float halfGrid = (float)gridSize / 2f; int nearestX = (int)((newX + halfGrid) / gridSize) * gridSize; int nearestY = (int)((newY + halfGrid) / gridSize) * gridSize; controllerBox.SetLocation(nearestX, nearestY); var targetBox = controllerBox.TargetBox; if (targetBox != null) { //move target box too targetBox.SetLocation(nearestX + gridSize, nearestY + gridSize); } }
void ResizeTargetWithSnapToGrid2(SpaceName tinyBoxSpaceName, UIControllerBox controllerBox, UIMouseEventArgs e, int dx, int dy) { //sample move with snap to grid Point pos = controllerBox.Position; int newX = pos.X + dx;// e.XDiff; int newY = pos.Y + dy;// e.YDiff; //snap to gridsize =5; //find nearest snap x int gridSize = 5; float halfGrid = (float)gridSize / 2f; int nearestX = (int)((newX + halfGrid) / gridSize) * gridSize; int nearestY = (int)((newY + halfGrid) / gridSize) * gridSize; int xdiff = nearestX - pos.X; int ydiff = nearestY - pos.Y; int diffX = 0, diffY = 0; var targetBox = controllerBox.TargetBox; if (targetBox != null) { var targetBoxLocation = targetBox.GetGlobalLocation(); diffX = this.Left - targetBoxLocation.X; diffY = this.Top - targetBoxLocation.Y; } switch (tinyBoxSpaceName) { case SpaceName.LeftTop: { if (xdiff != 0 || ydiff != 0) { controllerBox.SetLocation(controllerBox.Left + xdiff, controllerBox.Top + ydiff); controllerBox.SetSize(controllerBox.Width - xdiff, controllerBox.Height - ydiff); if (targetBox != null) { //move target box too targetBox.SetBounds(targetBox.Left + diffX + 5, targetBox.Top + diffY + 5, controllerBox.Width - 10, controllerBox.Height - 10); } } } break; case SpaceName.RightTop: { if (xdiff != 0 || ydiff != 0) { controllerBox.SetLocation(controllerBox.Left, controllerBox.Top + ydiff); controllerBox.SetSize(controllerBox.Width + xdiff, controllerBox.Height - ydiff); if (targetBox != null) { //move target box too targetBox.SetBounds(targetBox.Left + diffX + 5, targetBox.Top + diffY + 5, controllerBox.Width - 10, controllerBox.Height - 10); } } } break; case SpaceName.RightBottom: { if (xdiff != 0 || ydiff != 0) { controllerBox.SetSize(controllerBox.Width + xdiff, controllerBox.Height + ydiff); if (targetBox != null) { //move target box too targetBox.SetBounds(targetBox.Left + diffX + 5, targetBox.Top + diffY + 5, controllerBox.Width - 10, controllerBox.Height - 10); } } } break; case SpaceName.LeftBottom: { if (xdiff != 0 || ydiff != 0) { controllerBox.SetLocation(controllerBox.Left + xdiff, controllerBox.Top); controllerBox.SetSize(controllerBox.Width - xdiff, controllerBox.Height + ydiff); if (targetBox != null) { //move target box too targetBox.SetBounds(targetBox.Left + diffX + 5, targetBox.Top + diffY + 5, controllerBox.Width - 10, controllerBox.Height - 10); } } } break; } }
void SetUIMouseEventArgsInfo(UIMouseEventArgs mouseEventArg, int x, int y, UIMouseButtons button, int delta) { mouseEventArg.SetEventInfo( x, y, (UIMouseButtons)button, 0, delta); }
protected override void OnMouseMove(UIMouseEventArgs e) { if (e.IsDragging) { MoveWithSnapToGrid(this, e.DiffCapturedX, e.DiffCapturedY); e.MouseCursorStyle = MouseCursorStyle.Pointer; e.CancelBubbling = true; } base.OnMouseMove(e); }
protected override void OnMouseUp(UIMouseEventArgs e) { //create commadn history and add? var newBeginPoint = new Point(this.TargetBox.Left, this.TargetBox.Top); this.DesignBoardModule.HistoryRecordDzElementNewPosition( this.TargetBox, new Point(this.beginRect.Left, this.beginRect.Top), newBeginPoint); this.beginRect = new Rectangle(newBeginPoint.X, newBeginPoint.Y, this.TargetBox.Width, this.TargetBox.Height); base.OnMouseUp(e); }
public void OnMouseUp(UIMouseEventArgs e) { }
protected override void OnMouseWheel(UIMouseEventArgs e) { if (e.Delta < 0) { //scroll down this.StepSmallToMax(); } else { //up this.StepSmallToMin(); } }
protected virtual void OnMouseUp(UIMouseEventArgs e) { }
internal void InvokeMouseDoubleClick(S sender, T state, UIMouseEventArgs e) => MouseDoubleClick.Invoke(new SenderInfo(sender, state), e);
protected virtual void OnLostMouseFocus(UIMouseEventArgs e) { }
protected virtual void OnDoubleClick(UIMouseEventArgs e) { }
protected virtual void OnMouseHover(UIMouseEventArgs e) { }
protected virtual void OnMouseWheel(UIMouseEventArgs e) { }
protected virtual void OnMouseLeave(UIMouseEventArgs e) { }
void IEventListener.ListenMouseWheel(UIMouseEventArgs e) { OnMouseWheel(e); }
void IEventPortal.PortalMouseWheel(UIMouseEventArgs e) { }
void IEventListener.ListenMouseClick(UIMouseEventArgs e) { }
void IEventPortal.PortalMouseDown(UIMouseEventArgs e) { #if DEBUG if (this.dbugRootGraphics.dbugEnableGraphicInvalidateTrace) { this.dbugRootGraphics.dbugGraphicInvalidateTracer.WriteInfo("================"); this.dbugRootGraphics.dbugGraphicInvalidateTracer.WriteInfo("MOUSEDOWN"); this.dbugRootGraphics.dbugGraphicInvalidateTracer.WriteInfo("================"); } dbugMsgChainVersion = 1; int local_msgVersion = 1; #endif HitChain hitPointChain = GetFreeHitChain(); HitTestCoreWithPrevChainHint(hitPointChain, this._previousChain, e.X, e.Y); int hitCount = hitPointChain.Count; RenderElement hitElement = hitPointChain.TopMostElement; if (hitCount > 0) { //------------------------------ //1. origin object SetEventOrigin(e, hitPointChain); //------------------------------ var prevMouseDownElement = e.PreviousMouseDown; IEventListener currentMouseDown = null; //portal ForEachOnlyEventPortalBubbleUp(e, hitPointChain, (portal) => { portal.PortalMouseDown(e); //***** currentMouseDown = e.CurrentContextElement; return(true); }); //------------------------------ //use events if (!e.CancelBubbling) { e.CurrentContextElement = currentMouseDown = null; //clear ForEachEventListenerBubbleUp(e, hitPointChain, (listener) => { currentMouseDown = listener; listener.ListenMouseDown(e); //------------------------------------------------------- bool cancelMouseBubbling = e.CancelBubbling; if (prevMouseDownElement != null && prevMouseDownElement != listener) { prevMouseDownElement.ListenLostMouseFocus(e); prevMouseDownElement = null;//clear } //------------------------------------------------------- return(e.CancelBubbling || !listener.BypassAllMouseEvents); }); } if (prevMouseDownElement != currentMouseDown && prevMouseDownElement != null) { prevMouseDownElement.ListenLostMouseFocus(e); prevMouseDownElement = null; } } //--------------------------------------------------------------- #if DEBUG RootGraphic visualroot = this.dbugRootGraphics; if (visualroot.dbug_RecordHitChain) { visualroot.dbug_rootHitChainMsg.Clear(); HitInfo hitInfo; for (int tt = hitPointChain.Count - 1; tt >= 0; --tt) { hitInfo = hitPointChain.GetHitInfo(tt); RenderElement ve = hitInfo.hitElement; if (ve != null) { ve.dbug_WriteOwnerLayerInfo(visualroot, tt); ve.dbug_WriteOwnerLineInfo(visualroot, tt); string hit_info = new string('.', tt) + " [" + tt + "] " + "(" + hitInfo.point.X + "," + hitInfo.point.Y + ") " + ve.dbug_FullElementDescription(); visualroot.dbug_rootHitChainMsg.AddLast(new dbugLayoutMsg(ve, hit_info)); } } } #endif SwapHitChain(hitPointChain); e.StopPropagation(); #if DEBUG if (local_msgVersion != dbugMsgChainVersion) { return; } visualroot.dbugHitTracker.Write("stop-mousedown"); visualroot.dbugHitTracker.Play = false; #endif }
void IEventListener.ListenMouseDown(UIMouseEventArgs e) { OnMouseDown(e); }
// public override void OnDragStart(UIMouseEventArgs e) // { //#if DEBUG // if (this.dbugRootGraphic.dbugEnableGraphicInvalidateTrace) // { // this.dbugRootGraphic.dbugGraphicInvalidateTracer.WriteInfo("================"); // this.dbugRootGraphic.dbugGraphicInvalidateTracer.WriteInfo("START_DRAG"); // this.dbugRootGraphic.dbugGraphicInvalidateTracer.WriteInfo("================"); // } //#endif // HitTestCoreWithPrevChainHint( // hitPointChain.LastestRootX, // hitPointChain.LastestRootY); // DisableGraphicOutputFlush = true; // this.currentDragElem = null; // //----------------------------------------------------------------------- // ForEachEventListenerPreviewBubbleUp(this.hitPointChain, (hitobj, listener) => // { // listener.PortalMouseMove(e); // return true; // }); // //----------------------------------------------------------------------- // ForEachEventListenerBubbleUp(this.hitPointChain, (hit, listener) => // { // currentDragElem = listener; // listener.ListenDragEvent(UIDragEventName.DragStart, e); // return true; // }); // DisableGraphicOutputFlush = false; // FlushAccumGraphicUpdate(); // hitPointChain.SwapHitChain(); // } // public override void OnDrag(UIMouseEventArgs e) // { // if (currentDragElem == null) // { // return; // } //#if DEBUG // this.dbugRootGraphic.dbugEventIsDragging = true; //#endif // //if (currentDragingElement == null) // //{ // // return; // //} // //else // //{ // //} // //-------------- // DisableGraphicOutputFlush = true; // currentDragElem.ListenDragEvent(UIDragEventName.Dragging, e); // DisableGraphicOutputFlush = false; // FlushAccumGraphicUpdate(); // //Point globalDragingElementLocation = currentDragingElement.GetGlobalLocation(); // //e.TranslateCanvasOrigin(globalDragingElementLocation); // //e.SourceHitElement = currentDragingElement; // //Point dragPoint = hitPointChain.PrevHitPoint; // //dragPoint.Offset(currentXDistanceFromDragPoint, currentYDistanceFromDragPoint); // //e.Location = dragPoint; // //e.DragingElement = currentDragingElement; // //IEventListener ui = currentDragingElement.GetController() as IEventListener; // //if (ui != null) // //{ // // ui.ListenDragEvent(UIDragEventName.Dragging, e); // //} // //e.TranslateCanvasOriginBack(); // } // public override void OnDragStop(UIMouseEventArgs e) // { // if (currentDragElem == null) // { // return; // } //#if DEBUG // this.dbugRootGraphic.dbugEventIsDragging = false; //#endif // DisableGraphicOutputFlush = true; // currentDragElem.ListenDragEvent(UIDragEventName.DragStop, e); // DisableGraphicOutputFlush = false; // FlushAccumGraphicUpdate(); // //if (currentDragingElement == null) // //{ // // return; // //} // //DisableGraphicOutputFlush = true; // //Point globalDragingElementLocation = currentDragingElement.GetGlobalLocation(); // //e.TranslateCanvasOrigin(globalDragingElementLocation); // //Point dragPoint = hitPointChain.PrevHitPoint; // //dragPoint.Offset(currentXDistanceFromDragPoint, currentYDistanceFromDragPoint); // //e.Location = dragPoint; // //e.SourceHitElement = currentDragingElement; // //var script = currentDragingElement.GetController() as IEventListener; // //if (script != null) // //{ // // script.ListenDragEvent(UIDragEventName.DragStop, e); // //} // //e.TranslateCanvasOriginBack(); // //UIMouseEventArgs d_eventArg = new UIMouseEventArgs(); // //if (hitPointChain.DragHitElementCount > 0) // //{ // // ForEachDraggingObjects(this.hitPointChain, (hitobj, listener) => // // { // // //d_eventArg.TranslateCanvasOrigin(globalLocation); // // //d_eventArg.SourceHitElement = elem; // // //d_eventArg.DragingElement = currentDragingElement; // // //var script2 = elem.GetController(); // // //if (script2 != null) // // //{ // // //} // // //d_eventArg.TranslateCanvasOriginBack(); // // return true; // // }); // // //foreach (RenderElement elem in hitPointChain.GetDragHitElementIter()) // // //{ // // // Point globalLocation = elem.GetGlobalLocation(); // // // d_eventArg.TranslateCanvasOrigin(globalLocation); // // // d_eventArg.SourceHitElement = elem; // // // d_eventArg.DragingElement = currentDragingElement; // // // var script2 = elem.GetController(); // // // if (script2 != null) // // // { // // // } // // // d_eventArg.TranslateCanvasOriginBack(); // // //} // //} // DisableGraphicOutputFlush = false; // FlushAccumGraphicUpdate(); // } void BroadcastDragHitEvents(UIMouseEventArgs e) { //Point globalDragingElementLocation = currentDragingElement.GetGlobalLocation(); //Rectangle dragRect = currentDragingElement.GetGlobalRect(); //VisualDrawingChain drawingChain = this.WinRootPrepareRenderingChain(dragRect); //List<RenderElement> selVisualElements = drawingChain.selectedVisualElements; //int j = selVisualElements.Count; //LinkedList<RenderElement> underlyingElements = new LinkedList<RenderElement>(); //for (int i = j - 1; i > -1; --i) //{ // if (selVisualElements[i].ListeningDragEvent) // { // underlyingElements.AddLast(selVisualElements[i]); // } //} //if (underlyingElements.Count > 0) //{ // foreach (RenderElement underlyingUI in underlyingElements) // { // if (underlyingUI.IsDragedOver) // { // hitPointChain.RemoveDragHitElement(underlyingUI); // underlyingUI.IsDragedOver = false; // } // } //} //UIMouseEventArgs d_eventArg = UIMouseEventArgs.GetFreeDragEventArgs(); //if (hitPointChain.DragHitElementCount > 0) //{ // foreach (RenderElement elem in hitPointChain.GetDragHitElementIter()) // { // Point globalLocation = elem.GetGlobalLocation(); // d_eventArg.TranslateCanvasOrigin(globalLocation); // d_eventArg.SourceVisualElement = elem; // var script = elem.GetController(); // if (script != null) // { // } // d_eventArg.TranslateCanvasOriginBack(); // } //} //hitPointChain.ClearDragHitElements(); //foreach (RenderElement underlyingUI in underlyingElements) //{ // hitPointChain.AddDragHitElement(underlyingUI); // if (underlyingUI.IsDragedOver) // { // Point globalLocation = underlyingUI.GetGlobalLocation(); // d_eventArg.TranslateCanvasOrigin(globalLocation); // d_eventArg.SourceVisualElement = underlyingUI; // var script = underlyingUI.GetController(); // if (script != null) // { // } // d_eventArg.TranslateCanvasOriginBack(); // } // else // { // underlyingUI.IsDragedOver = true; // Point globalLocation = underlyingUI.GetGlobalLocation(); // d_eventArg.TranslateCanvasOrigin(globalLocation); // d_eventArg.SourceVisualElement = underlyingUI; // var script = underlyingUI.GetController(); // if (script != null) // { // } // d_eventArg.TranslateCanvasOriginBack(); // } //} //UIMouseEventArgs.ReleaseEventArgs(d_eventArg); }
//tempfix here internal void ChildNotifyMouseWheel(UIMouseEventArgs e) { if (e.Delta < 0) { //scroll down this.StepSmallToMax(); } else { //up this.StepSmallToMin(); } }
void ReleaseUIMouseEventArgs(UIMouseEventArgs mouseEventArgs) { mouseEventArgs.Clear(); _mouseEventStack.Push(mouseEventArgs); }
protected override void OnMouseWheel(UIMouseEventArgs e) { this.OwnerScrollBar.ChildNotifyMouseWheel(e); }
void IEventListener.ListenMouseDoubleClick(UIMouseEventArgs e) { }
protected override void OnMouseLeave(UIMouseEventArgs e) { if (e.IsDragging) { MoveWithSnapToGrid(this, e); e.MouseCursorStyle = MouseCursorStyle.Pointer; e.StopPropagation(); } base.OnMouseLeave(e); }
static void MoveWithSnapToGrid(UIControllerBox controllerBox, UIMouseEventArgs e) { //sample move with snap to grid Point pos = controllerBox.Position; int newX = pos.X + e.XDiff; int newY = pos.Y + e.YDiff; //snap to gridsize =5; //find nearest snap x int gridSize = controllerBox.GridSize; float halfGrid = (float)gridSize / 2f; int nearestX = (int)((newX + halfGrid) / gridSize) * gridSize; int nearestY = (int)((newY + halfGrid) / gridSize) * gridSize; controllerBox.MoveTo(nearestX, nearestY); }
void IEventListener.ListenMouseUp(UIMouseEventArgs e) { OnMouseUp(e); }
static void ResizeTargetWithSnapToGridWhenDragRelease(UIControllerBox controllerBox, UIMouseEventArgs e) { ////sample move with snap to grid //Point pos = controllerBox.Position; //int newX = pos.X + e.XDiff; //int newY = pos.Y + e.YDiff; ////snap to gridsize =5; ////find nearest snap x //int gridSize = 5; //float halfGrid = (float)gridSize / 2f; //int nearestX = (int)((newX + halfGrid) / gridSize) * gridSize; //int nearestY = (int)((newY + halfGrid) / gridSize) * gridSize; //int xdiff = nearestX - pos.X; //if (xdiff == 0) //{ // return; //} //controllerBox.SetSize(controllerBox.Width + xdiff, controllerBox.Height); var targetBox = controllerBox.TargetBox; if (targetBox != null) { int diffX = 0, diffY = 0; var targetBoxLocation = targetBox.GetGlobalLocation(); diffX = controllerBox.Left - targetBoxLocation.X; diffY = controllerBox.Top - targetBoxLocation.Y; //move target box too var newRect = new Rectangle(targetBox.Left + diffX + 5, targetBox.Top + diffY + 5, controllerBox.Width - 10, controllerBox.Height - 10); controllerBox.DesignBoardModule.HistoryRecordDzElementNewBounds( controllerBox.TargetBox, controllerBox.beginRect, newRect); controllerBox.beginRect = newRect; targetBox.SetBounds(newRect.Left, newRect.Top, newRect.Width, newRect.Height); } }
void IEventListener.ListenLostMouseFocus(UIMouseEventArgs e) { OnLostMouseFocus(e); }
void ReleaseMouseEvent(UIMouseEventArgs e) { e.Clear(); this.stockMouseEvents.Push(e); }
internal abstract void ListenMouseClick(object sender, UIMouseEventArgs e);
void IEventListener.ListenMouseUp(UIMouseEventArgs e) { //1. mouse up OnMouseUp(e); }
void IEventListener.ListenMouseDoubleClick(UIMouseEventArgs e) { OnDoubleClick(e); }
void IEventListener.ListenMouseLeave(UIMouseEventArgs e) { OnMouseLeave(e); }
void IEventPortal.PortalMouseUp(UIMouseEventArgs e) { #if DEBUG if (this.dbugRootGraphics.dbugEnableGraphicInvalidateTrace) { this.dbugRootGraphics.dbugGraphicInvalidateTracer.WriteInfo("================"); this.dbugRootGraphics.dbugGraphicInvalidateTracer.WriteInfo("MOUSEUP"); this.dbugRootGraphics.dbugGraphicInvalidateTracer.WriteInfo("================"); } #endif HitChain hitPointChain = GetFreeHitChain(); HitTestCoreWithPrevChainHint(hitPointChain, this._previousChain, e.X, e.Y); int hitCount = hitPointChain.Count; if (hitCount > 0) { SetEventOrigin(e, hitPointChain); //--------------------------------------------------------------- ForEachOnlyEventPortalBubbleUp(e, hitPointChain, (portal) => { portal.PortalMouseUp(e); return(true); }); //--------------------------------------------------------------- if (!e.CancelBubbling) { ForEachEventListenerBubbleUp(e, hitPointChain, (listener) => { listener.ListenMouseUp(e); return(true); }); } //--------------------------------------------------------------- if (e.IsAlsoDoubleClick) { ForEachEventListenerBubbleUp(e, hitPointChain, listener => { listener.ListenMouseDoubleClick(e); //------------------------------------------------------- //retrun true to stop this loop (no further bubble up) //return false to bubble this to upper control return(e.CancelBubbling || !listener.BypassAllMouseEvents); }); } if (!e.CancelBubbling) { if (e.IsAlsoDoubleClick) { //ForEachEventListenerBubbleUp(e, hitPointChain, listener => //{ // listener.ListenMouseDoubleClick(e); // //------------------------------------------------------- // //retrun true to stop this loop (no further bubble up) // //return false to bubble this to upper control // return e.CancelBubbling || !listener.BypassAllMouseEvents; //}); } else { ForEachEventListenerBubbleUp(e, hitPointChain, listener => { listener.ListenMouseClick(e); return(e.CancelBubbling || !listener.BypassAllMouseEvents); }); } } } SwapHitChain(hitPointChain); e.StopPropagation(); }