private void button1_Click(object sender, EventArgs e) { AddNumbers an = new AddNumbers(); if (an.ShowDialog() == DialogResult.OK) { NumberItem ni = new NumberItem(); ni.Set(an.Numbers); list.Add(ni); Modified = true; } RefreshList(); }
public void LoadFile(string fileName) { FileName = fileName; this.Text = Path.GetFileNameWithoutExtension(fileName); list.Clear(); using (StreamReader sr = new StreamReader(fileName)) { string s = sr.ReadLine(); while (s != null) { string[] w = s.Split(','); NumberItem ni = new NumberItem(); ni.Set(w); list.Add(ni); s = sr.ReadLine(); } } RefreshList(); }