示例#1
0
        private void loadDeckData()
        {
            byte[][][] deckBytes = dataAccess.LoadDecks();
            deckList = Deck.LoadDeckListFromBytes(deckBytes);
            deckListBinding.DataSource = deckList;
            deckDropdown.DataSource    = deckListBinding;

            deckEditDeckLeaderRankComboBox.DataSource    = DeckLeaderRank.RankList();
            deckEditDeckLeaderRankComboBox.SelectedIndex = ((Deck)deckDropdown.SelectedItem).DeckLeader.Rank.Index;

            refreshDeckInfoLabels();
        }
示例#2
0
        private void setupForm()
        {
            List <DeckLeaderRank> validRanks = DeckLeaderRank.RankList();

            validRanks.RemoveAt((int)DeckLeaderRankType.NCO);
            this.rankDropdown.DataSource    = validRanks;
            this.rankDropdown.DisplayMember = "Name";
            this.rankDropdown.ValueMember   = "Index";
            this.rankDropdown.DropDownStyle = ComboBoxStyle.DropDownList;

            this.enabledCheckbox.Checked = this.DeckLeaderAbility.Enabled;
            this.toggleDropdownVisibility(this.DeckLeaderAbility.Enabled);

            RankRequirementDeckLeaderAbility rankRequirementDeckLeaderAbility = (RankRequirementDeckLeaderAbility)this.DeckLeaderAbility;
            DeckLeaderRank unlockRank = rankRequirementDeckLeaderAbility.UnlockRank != null ? rankRequirementDeckLeaderAbility.UnlockRank : new DeckLeaderRank((int)DeckLeaderRankType.SECOND_LT);

            this.rankDropdown.SelectedValue = unlockRank.Index;
        }