private void loadToolStripMenuItem_Click(object sender, EventArgs e) { StreamReader sr = new StreamReader(str); FigureFactory factory = new FirstFactory(); vector.Load(sr, factory); sr.Close(); panel1.Refresh(); }