/// <summary>Graph has been clicked.</summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnClick(object sender, EventArgs e) { if (SingleClick != null) { SingleClick.Invoke(this, e); } }
void InvokeSingleClick(MouseButtonUpEventArgs args) { try { SingleClick?.Invoke(args); } catch (Exception e) { Urho.IO.Log.Write(LogLevel.Warning, $"There was an unexpected exception during the invocation of {nameof(SingleClick)}: {e.Message}"); } }
private IEnumerator WaitAndInvoke(int clickCount) { yield return(new WaitForSeconds(0.2f)); if (clickCount == 1) { SingleClick?.Invoke(); } else if (clickCount == 2) { DoubleClick?.Invoke(); } LastClick?.Invoke(clickCount); }
/// <summary>Graph has been clicked.</summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnChartClick(object sender, OxyMouseDownEventArgs e) { e.Handled = false; inRightClick = e.ChangedButton == OxyMouseButton.Right; if (e.ChangedButton == OxyMouseButton.Left) /// Left clicks only { if (e.ClickCount == 1 && SingleClick != null) { SingleClick.Invoke(this, e); } else if (e.ClickCount == 2) { OnMouseDoubleClick(sender, e); } } }
/// <summary>Graph has been clicked.</summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnChartClick(object sender, OxyMouseDownEventArgs e) { Gdk.EventButton button; e.Handled = false; if (e.ChangedButton == OxyMouseButton.Left) /// Left clicks only { if (e.ClickCount == 1 && SingleClick != null) { SingleClick.Invoke(this, e); } else /// Enable this when OxyPlot is fixed if (e.ClickCount == 2) { OnMouseDoubleClick(sender, e); } } }