public void OnBallInPlay(BallEventArgs e) { EventHandler ballInPlay = BallInPlay; if (ballInPlay != null) { ballInPlay(this, e); } }
static void Main1(string[] args) { Ball ball = new Ball(); Pitcher pitcher = new Pitcher(ball); BallEventArgs ballEventArgs = new BallEventArgs(45, 100); ball.OnBallInPlay(ballEventArgs); }