public delegate void ScoreChangeEventHandler (int newScore, ref bool cancel); public class Game { public event ScoreChangeEventHandler ScoreChange; int score; public int Score { get { return score; } set { if (score != value) { bool cancel = false; ScoreChange (value, ref cancel); if (! cancel) score = value; } } } } public class Referee { public Referee (Game game) { game.ScoreChange += new ScoreChangeEventHandler (game_ScoreChange); } private void game_ScoreChange (int newScore, ref bool cancel) { if (newScore < 100) System.Console.WriteLine ("Good Score"); else { cancel = true; System.Console.WriteLine ("No Score can be that high!"); } } } public class GameTest { public static void Main () { Game game = new Game (); Referee referee = new Referee (game); game.Score = 70; game.Score = 110; } }