예제 #1
0
        private void txTime_OnLostFocus(object sender, System.EventArgs e)
        {
            //get index of selected swimmer
            int i = lsSwimmers.SelectedIndex;
            //get that swimmer
            Swimmer swm = (Swimmer)ar[i];

            swm.time = txTime.Text;
        }
예제 #2
0
        private void lsSwimmers_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            //get index of selected swimmer
            int i = lsSwimmers.SelectedIndex;
            //get that swimmer
            Swimmer swm = (Swimmer)ar[i];

            //display her time
            txTime.Text = swm.getTime();
        }
예제 #3
0
        //-------------------------
        private void init()
        {
            ar = new ArrayList();               //create array list
            csFile fl = new csFile("500free.txt");
            //read in liens
            string s = fl.readLine();

            while (s != null)
            {
                //convert to tokens in swimmer object
                Swimmer swm = new Swimmer(s);
                ar.Add(swm);
                s = fl.readLine();
            }
            fl.close();
            //add names to list box
            for (int i = 0; i < ar.Count; i++)
            {
                Swimmer swm = (Swimmer)ar[i];
                lsSwimmers.Items.Add(swm.getName());
            }
        }