public MasteryIcon(MasteryDto dto, MasteryEditor.MasteryRow row) { InitializeComponent(); Row = row; Data = dto; if (Data.ranks == 1) { PointsLabel.Visibility = Visibility.Collapsed; } }
private void MatchListBox_SelectedIndexChanged(object sender, EventArgs e) { errorLabel.Hide(); try { resetMasteries(); var match = Get_Match_From_Match_ID(((MatchListBoxType)MatchListBox.SelectedItem).id, apikey); // Get correct Id from participantIdentities long CorrectSummoner = -1; foreach (ParticipantIdentity ident in match.participantIdentities) { if (ident.player.summonerName == summonerNameInput1.Text) { CorrectSummoner = ident.participantId; break; } } // With the Id, find the right participant List <Mastery> masteries = null; foreach (Participant part in match.participants) { if (part.participantId == CorrectSummoner) { masteries = part.masteries; break; } } // Set rank labels in masteriesPanel control foreach (Mastery m in masteries) { Control label = masteriesPanel.Controls.Find("l" + m.masteryId, true)[0]; label.Text = m.rank.ToString(); Control box = masteriesPanel.Controls.Find("box" + m.masteryId, true)[0]; MasteryDto mst = Masteries.data[m.masteryId.ToString()]; toolTip1.SetToolTip(box, mst.name + "\n\n" + mst.description[m.rank - 1]); } } catch { Show_Error("Mastery information is from an older, unsupported verison of League"); } }