Пример #1
0
        private void AddImportProject_Click(object sender, EventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            dlg.Filter = Program.ProjectFilter;

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                Project p = Serialisation <Project> .Load(dlg.FileName, SerialisationMode.Binary);

                if (p != null)
                {
                    RegionalMapSelectForm map_dlg = new RegionalMapSelectForm(p.RegionalMaps, null, true);
                    if (map_dlg.ShowDialog(this) != DialogResult.OK)
                    {
                        return;
                    }

                    Session.Project.RegionalMaps.AddRange(map_dlg.Maps);
                    Session.Modified = true;

                    update_maps();
                }
            }
        }
Пример #2
0
        private void AddImportProject_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog()
            {
                Filter = Program.ProjectFilter
            };

            if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                Project project = Serialisation <Project> .Load(openFileDialog.FileName, SerialisationMode.Binary);

                if (project != null)
                {
                    RegionalMapSelectForm regionalMapSelectForm = new RegionalMapSelectForm(project.RegionalMaps, null, true);
                    if (regionalMapSelectForm.ShowDialog(this) != System.Windows.Forms.DialogResult.OK)
                    {
                        return;
                    }
                    Session.Project.RegionalMaps.AddRange(regionalMapSelectForm.Maps);
                    Session.Modified = true;
                    this.update_maps();
                }
            }
        }