Пример #1
0
 public void RemoveFromZone(MapIDControl box, MapStatus location)
 {
     box.SetSelected(false);
     box.SetConflict(false);
     if (box == LastImportSelected)
     {
         LastImportSelected = null;
     }
     if (box == LastExistingSelected)
     {
         LastExistingSelected = null;
     }
     if (location == MapStatus.Importing)
     {
         UI.ImportZone.Controls.Remove(box);
         ImportingMapPreviews.Remove(box);
         box.MouseDown -= ImportingBox_MouseDown;
     }
     else if (location == MapStatus.Existing)
     {
         UI.ExistingZone.Controls.Remove(box);
         ExistingMapPreviews.Remove(box);
         box.MouseDown -= ExistingBox_MouseDown;
     }
 }
Пример #2
0
        private void ExistingBox_MouseDown(object sender, MouseEventArgs e)
        {
            MapIDControl box = sender as MapIDControl;

            if (e.Button == MouseButtons.Right)
            {
                if (!box.Selected)
                {
                    foreach (var other in ExistingMapPreviews)
                    {
                        other.SetSelected(false);
                    }
                    box.SetSelected(true);
                }
                UI.ExistingContextMenu.Show(box, new Point(e.X, e.Y));
            }
            else
            {
                ClickSelect(box, MapStatus.Existing);
            }
        }