private void reload() { lsKids.Items.Clear(); swdata.moveFirst(); while (swdata.hasMoreElements()) { Swimmer sw = swdata.getSwimmer(); lsKids.Items.Add(sw.getName()); } }
private void btClone_Click(object sender, System.EventArgs e) { SwimData newSd = (SwimData)swdata.Clone(); newSd.sort(); while (newSd.hasMoreElements()) { Swimmer sw = (Swimmer)newSd.getSwimmer(); lsNewKids.Items.Add(sw.getName()); } }
//----- public SwimData(string filename) { swdata = new ArrayList(); csFile fl = new csFile(filename); fl.OpenForRead(); string s = fl.readLine(); while (s != null) { Swimmer sw = new Swimmer(s); swdata.Add(sw); s = fl.readLine(); } fl.close(); }
//--------- public int CompareTo(object swo) { Swimmer sw = (Swimmer)swo; return(lname.CompareTo(sw.getLName())); }