Exemple #1
0
 protected override void OnMouseMove(MouseEventArgs e)
 {
     if (e.Button != MouseButtons.None && _cellUnderCursorLocation.HasValue && !_model.GameOver)
     {
         _cellUnderCursorLocation = CellByLocation.GetCellLocationByCursorPosition(e.Location, _model.Field);
     }
     else
     {
         _cellUnderCursorLocation = null;
     }
     Invalidate();
 }
Exemple #2
0
 protected override void OnMouseDown(MouseEventArgs e)
 {
     MouseDown?.Invoke();
     if (!_model.GameOver)
     {
         _cellUnderCursorLocation = CellByLocation.GetCellLocationByCursorPosition(e.Location, _model.Field);
     }
     else
     {
         _cellUnderCursorLocation = null;
     }
     Invalidate();
 }