Esempio n. 1
0
 private void MapContextEdit_Click(object sender, EventArgs e)
 {
     if (this.MapPanel.SelectedLocation != null)
     {
         int             mapLocation     = this.fMap.Locations.IndexOf(this.MapPanel.SelectedLocation);
         MapLocationForm mapLocationForm = new MapLocationForm(this.MapPanel.SelectedLocation);
         if (mapLocationForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             this.fMap.Locations[mapLocation] = mapLocationForm.MapLocation;
             this.MapPanel.Invalidate();
             Session.Modified = true;
         }
     }
 }
Esempio n. 2
0
        private void MapContextEdit_Click(object sender, EventArgs e)
        {
            if (MapPanel.SelectedLocation != null)
            {
                int index = fMap.Locations.IndexOf(MapPanel.SelectedLocation);

                MapLocationForm dlg = new MapLocationForm(MapPanel.SelectedLocation);
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    fMap.Locations[index] = dlg.MapLocation;
                    MapPanel.Invalidate();

                    Session.Modified = true;
                }
            }
        }
Esempio n. 3
0
        private void MapContextAddLocation_Click(object sender, EventArgs e)
        {
            if (fRightClickLocation == PointF.Empty)
            {
                return;
            }

            MapLocation loc = new MapLocation();

            loc.Name  = "New Location";
            loc.Point = fRightClickLocation;

            MapLocationForm dlg = new MapLocationForm(loc);

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                fMap.Locations.Add(loc);
                MapPanel.Invalidate();

                Session.Modified = true;
            }
        }