/// <inheritdoc/> protected override void OnMouseClick(MouseEventArgs e) { if (e == null) { throw new ArgumentNullException("e"); } Traces.Mouse.Trace(" - {0}.OnMouseClick - Shift: {1}; Ctl: {2}; Alt: {3}", Name, IsShiftKeyDown, IsCtlKeyDown, IsAltKeyDown); var eventArgs = new HexEventArgs(GetHexCoords(e.Location), ModifierKeys, e.Button, e.Clicks, e.X, e.Y, e.Delta); if (e.Button == MouseButtons.Middle) { base.OnMouseClick(eventArgs); } else if (e.Button == MouseButtons.Right) { OnMouseRightClick(eventArgs); } else if (IsAltKeyDown && !IsCtlKeyDown) { OnMouseAltClick(eventArgs); } else if (IsCtlKeyDown) { OnMouseCtlClick(eventArgs); } else { OnMouseLeftClick(eventArgs); } }
/// <summary>Raise the HotspotHexChange event.</summary> protected virtual void OnHotspotHexChange(HexEventArgs e) { if (e == null) { throw new ArgumentNullException("e"); } DataContext.Model.HotspotHex = e.Coords; HotspotHexChange.Raise(this, e); Refresh(); }
/// <summary>Raise the MouseLeftClick event.</summary> protected virtual void OnMouseLeftClick(HexEventArgs e) { if (e == null) { throw new ArgumentNullException("e"); } DataContext.Model.StartHex = e.Coords; MouseLeftClick.Raise(this, e); Refresh(); }
/// <summary>Announces that the mouse is now over a new hex.</summary> void HotspotHexChange(object sender, HexEventArgs e) { if (e == null) { throw new ArgumentNullException("e"); } if (e.Coords != HotspotHex) { HotspotHex = e.Coords; } }
/// <summary>TODO</summary> protected virtual void OnHotspotHexChange(HexEventArgs e) { if (e == null) { throw new ArgumentNullException("e"); } var handler = HotspotHexChange; if (handler != null) { handler(this, e); } }
/// <summary>TODO</summary> protected virtual void OnMouseRightClick(HexEventArgs e) { if (e == null) { throw new ArgumentNullException("e"); } var handler = MouseRightClick; if (handler != null) { handler(this, e); } }
protected void PanelBoard_HotSpotHexChange(object sender, HexEventArgs e) => RefreshAfter(() => { MapBoard.HotspotHex = e.Coords; });
/// <summary>Raise the HotspotHexChange event.</summary> protected virtual void OnHotspotHexChange(HexEventArgs e) { HotspotHexChange.Raise(this, e); }
/// <summary>Raise the MouseRightClick event.</summary> protected virtual void OnMouseRightClick(HexEventArgs e) { MouseRightClick.Raise(this, e); }