Example #1
0
 public void OnXChanged()
 {
     if (XChanged != null)
     {
         XChanged.Invoke(this, new EventArgs());
     }
 }
Example #2
0
 /// <summary>
 /// X value has changed.
 /// </summary>
 /// <param name="sender">Sender of event</param>
 /// <param name="e">Event arguments</param>
 private void xComboBox_TextChanged(object sender, EventArgs e)
 {
     if (XChanged != null)
     {
         XChanged.Invoke(sender, e);
     }
 }
Example #3
0
 internal void MoveTo(double x, double y)
 {
     if (!Movable)
     {
         return;
     }
     X = x;
     Y = y;
     TriggerPositionChanged();
     XChanged?.Invoke(X);
     YChanged?.Invoke(Y);
     ReRenderIfOffCanvasChanged();
     StateHasChanged();
 }
Example #4
0
 private void Element_MouseMove(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Right || e.Button == MouseButtons.Left)
     {
         if (xMouse != e.X)
         {
             XChanged?.Invoke(e.X - xMouse);
         }
         if (yMouse != e.Y)
         {
             YChanged?.Invoke(yMouse - e.Y);
         }
         if (xMouse != e.X || yMouse != e.Y)
         {
             BothChanged?.Invoke(e.X - xMouse, yMouse - e.Y);
         }
     }
     xMouse = e.X;
     yMouse = e.Y;
 }
Example #5
0
        private void ProcessButtonsChangeEvents(GamepadModel state, GamepadModel previousState)
        {
            if (previousState is null)
            {
                return;
            }

            if (previousState.IsAPressed != state.IsAPressed)
            {
                AChanged?.Invoke(this, state.IsAPressed);
            }
            if (previousState.IsBPressed != state.IsAPressed)
            {
                BChanged?.Invoke(this, state.IsBPressed);
            }
            if (previousState.IsXPressed != state.IsXPressed)
            {
                XChanged?.Invoke(this, state.IsXPressed);
            }
            if (previousState.IsYPressed != state.IsYPressed)
            {
                YChanged?.Invoke(this, state.IsYPressed);
            }

            if (previousState.IsBackPressed != state.IsBackPressed)
            {
                BackChanged?.Invoke(this, state.IsBackPressed);
            }
            if (previousState.IsStartPressed != state.IsStartPressed)
            {
                StartChanged?.Invoke(this, state.IsStartPressed);
            }

            if (previousState.DPad.IsDownPressed != state.DPad.IsDownPressed)
            {
                DPadDownChanged?.Invoke(this, state.DPad.IsDownPressed);
            }

            if (previousState.DPad.IsUpPressed != state.DPad.IsUpPressed)
            {
                DPadUpChanged?.Invoke(this, state.DPad.IsUpPressed);
            }

            if (previousState.DPad.IsLeftPressed != state.DPad.IsLeftPressed)
            {
                DPadLeftChanged?.Invoke(this, state.DPad.IsLeftPressed);
            }

            if (previousState.DPad.IsRightPressed != state.DPad.IsRightPressed)
            {
                DPadRightChanged?.Invoke(this, state.DPad.IsRightPressed);
            }

            if (previousState.IsLeftThumbStickPressed != state.IsLeftThumbStickPressed)
            {
                LeftThumbStickPressedChanged?.Invoke(this, state.IsLeftThumbStickPressed);
            }

            if (previousState.IsRightThumbStickPressed != state.IsRightThumbStickPressed)
            {
                RightThumbStickPressedChanged?.Invoke(this, state.IsRightThumbStickPressed);
            }
        }