private void WindowLoaded(object sender, RoutedEventArgs e) { var none = new StandingWrapper("<None>", .0); cbCorp.Items.Add(none); cbFaction.Items.Add(none); cbCorp.SelectedIndex = 0; cbFaction.SelectedIndex = 0; var standings = new NPCStandings( _chara.KeyId, _chara.VCode, _chara.CharId.ToString(CultureInfo.InvariantCulture) ); standings.Query(); foreach (NPCStandings.Standing standing in standings.standings.NPCCorporations) { var wrap = new StandingWrapper(standing.fromName, standing.standing); cbCorp.Items.Add(wrap); } foreach (NPCStandings.Standing standing in standings.standings.factions) { var wrap = new StandingWrapper(standing.fromName, standing.standing); cbFaction.Items.Add(wrap); } ToolTipService.SetShowDuration(imgHelp, int.MaxValue); }
public void btnUpdateClick(object sender, RoutedEventArgs e) { try { // Skills var sheet = new CharacterSheet( profile.keyId, profile.vcode, profile.charId.ToString(CultureInfo.InvariantCulture) ); sheet.Query(); if (sheet.characterID > 0) { foreach (CharacterSheet.Skill skill in sheet.skills) { if (skill.typeID == 3446) //"Broker Relations" { profile.brokerRelations = skill.level; } if (skill.typeID == 16622) //"Accounting" { profile.accounting = skill.level; } } //Standings var standings = new NPCStandings( profile.keyId, profile.vcode, profile.charId.ToString(CultureInfo.InvariantCulture) ); standings.Query(); if (profile.corporation != null) { foreach (NPCStandings.Standing standing in standings.standings.NPCCorporations) { if (profile.corporation == standing.fromName) { profile.corpStanding = standing.standing; } } } if (profile.faction != null) { foreach (NPCStandings.Standing standing in standings.standings.factions) { if (profile.faction == standing.fromName) { profile.factionStanding = standing.standing; } } } updateSettingsDisplay();; MessageBox.Show("Profile successfully updated"); } else { MessageBox.Show("An error occured while updating the profile. The API key might have been deleted or modified."); } } catch (Exception) { MessageBox.Show("An error occured while updating the profile."); } }