private void init() { kdata = new KidData("50free.txt"); KidIterator kiter = kdata.getIterator(); while (kiter.MoveNext()) { Kid kd = (Kid)kiter.Current; lsKids.Items.Add(kd.getFrname() + " " + kd.getLname()); } IDictionaryEnumerator clubiter = kdata.getClubs(); while (clubiter.MoveNext()) { cbClubs.Items.Add((string)clubiter.Value); } }
public KidData(string filename) { kids = new ArrayList(); clubs = new Hashtable(); csFile fl = new csFile(filename); fl.OpenForRead(); string line = fl.readLine(); while (line != null) { Kid kd = new Kid(line); string club = kd.getClub(); if (!clubs.Contains(club)) { clubs.Add(club, club); } kids.Add(kd); line = fl.readLine(); } fl.close(); index = 0; }
//----- public bool compare(Kid kd, int key) { return(compareTo(getData(key), kd.getData(key))); }