Beispiel #1
0
 private void EditBtn_Click(object sender, EventArgs e)
 {
     if (this.SelectedMap != null)
     {
         int             map             = Session.Project.RegionalMaps.IndexOf(this.SelectedMap);
         RegionalMapForm regionalMapForm = new RegionalMapForm(this.SelectedMap, null);
         if (regionalMapForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             Session.Project.RegionalMaps[map] = regionalMapForm.Map;
             Session.Modified = true;
             this.update_maps();
             this.SelectedMap = regionalMapForm.Map;
         }
     }
 }
Beispiel #2
0
        private void AddBtn_Click(object sender, EventArgs e)
        {
            RegionalMap regionalMap = new RegionalMap()
            {
                Name = "New Map"
            };
            RegionalMapForm regionalMapForm = new RegionalMapForm(regionalMap, null);

            if (regionalMapForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                Session.Project.RegionalMaps.Add(regionalMapForm.Map);
                Session.Modified = true;
                this.update_maps();
                this.SelectedMap = regionalMapForm.Map;
            }
        }
        private void AddBtn_Click(object sender, EventArgs e)
        {
            RegionalMap m = new RegionalMap();

            m.Name = "New Map";

            RegionalMapForm dlg = new RegionalMapForm(m, null);

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                Session.Project.RegionalMaps.Add(dlg.Map);
                Session.Modified = true;

                update_maps();

                SelectedMap = dlg.Map;
            }
        }
        private void EditBtn_Click(object sender, EventArgs e)
        {
            if (SelectedMap != null)
            {
                int index = Session.Project.RegionalMaps.IndexOf(SelectedMap);

                RegionalMapForm dlg = new RegionalMapForm(SelectedMap, null);
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    Session.Project.RegionalMaps[index] = dlg.Map;
                    Session.Modified = true;

                    update_maps();

                    SelectedMap = dlg.Map;
                }
            }
        }