コード例 #1
0
        private void LoadInitialSampleData()
        {
            var accessor = new ScoreBoardAccessor(new ScoreBoardDisplay());

            Score = accessor.EditHomeTeam("Nebraska One Flames");
            Score = accessor.EditVisitorTeam("Omaha Spikes");
            Score = accessor.AddHomeScore();
            Score = accessor.AddVisitorScore();
        }
コード例 #2
0
        private void dispatcherTimer_Tick(object sender, EventArgs e)
        {
            var accessor = new ScoreBoardAccessor(Score);

            if (random.Next(0, 10) % 2 == 0)
            {
                Score = accessor.AddHomeScore();
            }
            else
            {
                Score = accessor.AddVisitorScore();
            }

            if (Score.HomeScore > 5 || Score.VisitorScore > 5)
            {
                dispatcherTimer.Stop();
                var adWindow = new AdWindow();
                adWindow.Closed += new EventHandler(adWindow_Closed);
                adWindow.Show();
            }
        }
コード例 #3
0
 public ScoreBoardAccessor(ScoreBoardDisplay score)
 {
     Score = score;
 }