Пример #1
0
 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();
 }
Пример #2
0
 private void saveToolStripMenuItem_Click(object sender, EventArgs e)
 {
     saveFileDialog1.Title  = "Save";
     saveFileDialog1.Filter = "XML file|*.xml|JSON file|*.json|CSV file|*.csv|YAML file|*.yaml";
     if (saveFileDialog1.ShowDialog() == DialogResult.OK)
     {
         string         path     = saveFileDialog1.FileName;
         IWorkWithFiles saveFile = FileRep.findExtention(path);
         saveFile.Save(bouncingBalls, path);
     }
     saveFileDialog1.Dispose();
 }