示例#1
0
        private void ClickSelect(MapIDControl box, MapStatus area)
        {
            MapIDControl current = area == MapStatus.Importing ? LastImportSelected : LastExistingSelected;
            var          list    = area == MapStatus.Importing ? ImportingMapPreviews : ExistingMapPreviews;

            box.ToggleSelected();
            if (Control.ModifierKeys == Keys.Shift && current != null)
            {
                bool state = current.Selected;
                int  first = list.IndexOf(current);
                int  last  = list.IndexOf(box);
                for (int i = Math.Min(first, last); i < Math.Max(first, last); i++)
                {
                    list[i].SetSelected(state);
                }
            }
            if (area == MapStatus.Importing)
            {
                LastImportSelected = box;
            }
            else
            {
                LastExistingSelected = box;
            }
        }
示例#2
0
        private void ClickSelect(MapIDControl box)
        {
            var controls = Controls.OfType <MapIDControl>().ToList();
            var current  = LastSelected;

            box.ToggleSelected();
            if (Control.ModifierKeys == Keys.Shift && current != null)
            {
                bool state = current.IsSelected;
                int  first = controls.IndexOf(current);
                int  last  = controls.IndexOf(box);
                for (int i = Math.Min(first, last); i < Math.Max(first, last); i++)
                {
                    controls[i].SetSelected(state);
                }
            }
            LastSelected = box;
        }