private void Button_Load_Click(object sender, EventArgs e)
        {
            Simulation simulation = SimulationSaver.Load(filePath);

            if (simulation != null)
            {
                parentForm.StartNewSimulation(simulation);
            }
            else
            {
                MessageBox.Show("Error was occured during load");
            }
            Close();
        }
예제 #2
0
        public void SaveCurrentSimulation()
        {
            DialogResult result = SelectPathDialog.ShowDialog();

            SelectPathDialog.OverwritePrompt = true;
            if (result == DialogResult.OK)
            {
                string path = SelectPathDialog.FileName;
                if (path.Substring(path.Length - 5) == ".gols")
                {
                    SimulationSaver.Save(simulation, path);
                }
                else
                {
                    MessageBox.Show("Wrong file format! File name should end with '.gols'");
                }
            }
        }