protected override void OnMouseMove(MouseEventArgs e)
{
base.OnMouseMove(e);
Position mousePosition = PositionAtPoint(new Point(e.X, e.Y));
Cells.ICellVirtual mouseCell = GetCell(mousePosition);
//Call MouseMove on the cell that receive tha MouseDown event
if (MouseDownPosition.IsEmpty() == false)
{
Cells.ICellVirtual mouseDownCell = GetCell(MouseDownPosition);
if (mouseDownCell != null)
Controller.OnMouseMove(new CellContext(this, MouseDownPosition, mouseDownCell), e);
}
else //se non ho nessuna cella attualmente che ha ricevuto un mousedown, l'evento di MouseMove viene segnalato sulla cella correntemente sotto il Mouse
{
// se non c'è nessuna cella MouseDown cambio la cella corrente sotto il Mouse
ChangeMouseCell(mousePosition);//in ogni caso cambio la cella corrente
if (mousePosition.IsEmpty() == false && mouseCell != null)
{
// I call MouseMove on the current cell only if there aren't any cells under the mouse
Controller.OnMouseMove(new CellContext(this, mousePosition, mouseCell), e);
}
}
}