private void lstOwners_SelectedIndexChanged(object sender, EventArgs e) { if (lastSelectedOwner != null) { if (lastSelectedOwner.Corp && !lastSelectedOwner.Equals((CharCorpOption)lstOwners.SelectedItem)) { long id = lastSelectedOwner.Corp ? lastSelectedOwner.CharacterObj.CorpID : lastSelectedOwner.CharacterObj.CharID; if (useDataFrom.ContainsKey(id)) { useDataFrom.Remove(id); } if (chkWallets.CheckedItems.Count > 0) { useDataFrom.Add(id, new List<int>()); foreach (object wallet in chkWallets.CheckedItems) { string walletText = wallet.ToString(); int walletID = int.Parse(walletText.Remove(walletText.IndexOf(" "))); useDataFrom[id].Add(walletID); } } } } lastSelectedOwner = (CharCorpOption)lstOwners.SelectedItem; RefreshWalletList(); }
public List<CharCorpOption> GetCharCorpOptions(APIDataType type, bool charsOnly) { List<CharCorpOption> options = new List<CharCorpOption>(); foreach (EVEAccount account in _accounts) { foreach (APICharacter apichar in account.Chars) { if (account.Type == CharOrCorp.Char && apichar.CharIncWithRptGroup) { CharCorpOption opt = new CharCorpOption(apichar, false); options.Add(opt); } if (account.Type == CharOrCorp.Corp && !charsOnly && apichar.CorpIncWithRptGroup && apichar.CharHasCorporateAccess(type)) { CharCorpOption opt = new CharCorpOption(apichar, true); options.Add(opt); } } } return options; }