示例#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
文件: Canvas.cs 项目: MGnuskina/Tasks
 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();
 }