public virtual void OnRaisePieceMoving(PieceMoveEventArgs e) { PieceMovedEventHandler handler = RaisePieceMoving; if (handler != null) { handler(this, e); } }
public bool MoveTo(BoardCoordinate coordinate) { PieceMoveEventArgs eventArgs; bool piecemoved = this._piece.MoveTo(coordinate); eventArgs = new PieceMoveEventArgs(piecemoved, coordinate, coordinate); this.RaisePieceMoving(this, eventArgs); if (piecemoved) { // change parent } this.RaisePieceMoved(this, eventArgs); return(piecemoved); }