/// <summary> /// Initializes the Form. /// Call this after Colleges, Photos & PBPs have been set. /// </summary> private void SetupGui() { if (SetupKey()) { //ClearControls(mStatsTab); //ClearControls(mStrategyTab); foreach (string attr in mKeyParts) { if (attr.Length > 0 && sCoachStats.IndexOf("," + attr + ",") > -1) { AddStat(attr); } } foreach (string attr in mKeyParts) { if (attr.Length > 0 && sCoachStrategyAttrs.IndexOf(attr + ",") > -1) { AddStrategy(attr); } } List <string> coaches = InputParser.GetCoaches(Data); foreach (string line in coaches) { this.m_TeamsComboBox.Items.Add(GetAttribute(line, "Team")); } } }
private void SetCurrentCoach() { List <string> coaches = InputParser.GetCoaches(Data); string team = m_TeamsComboBox.SelectedItem.ToString(); string tmp = "Coach," + team; string current = null; foreach (string coach in coaches) { if (coach.StartsWith(tmp)) { current = coach; break; } } if (current != null) { SetCoachData(current); } }
private void OnSelectionStartChanged(int oldVal, int newValue) { string coachLine = InputParser.GetLine(newValue, Data); List <string> coaches = InputParser.GetCoaches(Data); if (coaches != null) { for (int i = 0; i < coaches.Count; i++) { if (coaches[i].StartsWith(coachLine)) { m_TeamsComboBox.SelectedIndex = i; break; } } mInitializing = true; SetCurrentCoach(); mInitializing = false; // keep it here, initialization failed //this.mPlayerIndexUpDown.Maximum = coaches.Length - 1; } }