private void loadToolStripMenuItem_Click(object sender, EventArgs e) { openFileDialog1.Title = "Open"; openFileDialog1.Filter = "XML file|*.xml|JSON file|*.json|CSV file|*.csv|YAML file|*.yaml"; if (openFileDialog1.ShowDialog() == DialogResult.OK) { string path = openFileDialog1.FileName; IWorkWithFiles openFile = FileRep.findExtention(path); bouncingBalls = openFile.Load(path); } openFileDialog1.Dispose(); }
private void loadToolStripMenuItem_Click(object sender, EventArgs e) { openFileDialog1.Title = "Open"; openFileDialog1.Filter = "XML file|*.xml|JSON file|*.json|CSV file|*.csv|YAML file|*.yaml"; if (openFileDialog1.ShowDialog() == DialogResult.OK) { ShapeOriginator originator = new ShapeOriginator(); string path = openFileDialog1.FileName; IWorkWithFiles openFile = LSFactory.findExtention(path); originator.SetMemento(new ShapeMemento(openFile.Load(path))); SetControls(originator); } openFileDialog1.Dispose(); }