Example #1
0
        /// <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;
     }
 }
Example #5
0
        /// <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);
            }
        }
Example #6
0
        /// <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);
            }
        }
Example #7
0
 protected void PanelBoard_HotSpotHexChange(object sender, HexEventArgs e)
 => RefreshAfter(() => { MapBoard.HotspotHex = e.Coords; });
Example #8
0
 /// <summary>Raise the HotspotHexChange event.</summary>
 protected virtual void OnHotspotHexChange(HexEventArgs e)
 {
     HotspotHexChange.Raise(this, e);
 }
Example #9
0
 /// <summary>Raise the MouseRightClick event.</summary>
 protected virtual void OnMouseRightClick(HexEventArgs e)
 {
     MouseRightClick.Raise(this, e);
 }