private static AnnPointerEventArgs ConvertPointerEventArgs(InteractiveEventArgs e, bool isDoubleTap) { // Convert the point var point = LeadPointD.Create(e.Position.X, e.Position.Y); // Convert the mouse button var mouseButton = AnnMouseButton.None; if (!isDoubleTap) { if (e.MouseButton == MouseButtons.Left) { mouseButton = AnnMouseButton.Left; } if (e.MouseButton == MouseButtons.Right) { mouseButton = AnnMouseButton.Right; } } else { mouseButton = AnnMouseButton.Left; } var args = AnnPointerEventArgs.Create(mouseButton, point); args.IsHandled = e.IsHandled; return(args); }
// Fire the AutomationPointerMove event protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e); if (!IsAutomationAttached || !AutomationEnabled) { return; } if (AutomationPointerMove != null) { // Convert the point to automation location LeadPointD location = LeadPointD.Create(e.Location.X, e.Location.Y); AutomationPointerMove(this, AnnPointerEventArgs.Create(AnnMouseButton.Left, location)); } }