コード例 #1
0
        private ClockForm BuildMainForm()
        {
            var systemPlayer = PlayerUtilities.LoadSystemPlayer();

            return(new ClockForm()
            {
                GameRepository = gamesRepo,
                SystemPlayer = systemPlayer
            });
        }
コード例 #2
0
        private void LoadPlayers()
        {
            var players      = GameRepository.AllPlayers().ToList();
            var systemPlayer = PlayerUtilities.LoadSystemPlayer();

            if (!players.Contains(systemPlayer))
            {
                players.Add(systemPlayer);
            }

            var playerListBox = playerCheckedListBox as ListBox;

            var obsPlayers = new BindingList <Player>(players);

            playerListBox.DataSource    = obsPlayers;
            playerListBox.DisplayMember = "Name";
            playerListBox.ValueMember   = "Id";
        }