2 writes to SelectionService
System.Windows.Forms.Design (2)
System\Windows\Forms\Design\CommandSet.cs (2)
200SelectionService = site.GetService<ISelectionService>(); 362SelectionService = null;
61 references to SelectionService
System.Windows.Forms.Design (61)
System\Windows\Forms\Design\CommandSet.cs (50)
201Debug.Assert(SelectionService is not null, "CommandSet relies on the selection service, which is unavailable."); 202SelectionService?.SelectionChanged += OnSelectionChanged; 361SelectionService?.SelectionChanged -= OnSelectionChanged; 474ICollection selectedComponents = SelectionService!.GetSelectedComponents(); 709if (SelectionService?.PrimarySelection is IComponent pri) 728if (SelectionService?.PrimarySelection is IComponent comp && TryGetService(out IDesignerHost? host) && 777DesignerTransaction trans = SelectionService.SelectionCount > 1 778? host.CreateTransaction(string.Format(SR.DragDropMoveComponents, SelectionService.SelectionCount)) 801List<IComponent> selComps = [..SelectionService.GetSelectedComponents().Cast<IComponent>()]; 909foreach (IComponent component in SelectionService.GetSelectedComponents()) 928if (component == SelectionService.PrimarySelection) 966if (SelectionService is null) 977ICollection comps = SelectionService.GetSelectedComponents(); 1114if (SelectionService is null) 1124ICollection selectedComponents = SelectionService.GetSelectedComponents(); 1234if (SelectionService is null) 1245ICollection selectedComponents = SelectionService.GetSelectedComponents(); 1384if (SelectionService is null) 1429if (SelectionService is null) 1472SelectionService.SetSelectedComponents(Array.Empty<object>(), SelectionTypes.Replace); 1552SelectionService.SetSelectedComponents(new object[] { commonParent }, SelectionTypes.Replace); 1554else if (SelectionService.PrimarySelection is null) 1556SelectionService.SetSelectedComponents(new object[] { host.RootComponent }, SelectionTypes.Replace); 1577if (site is null || SelectionService is null || !TryGetService(out IDesignerHost? host)) 1589ICollection comps = SelectionService.GetSelectedComponents(); 1600SelectionService.SetSelectedComponents(Array.Empty<object>(), SelectionTypes.Replace); 1762if (commonParent is not null && SelectionService.PrimarySelection is null) 1797SelectionService.SetSelectedComponents(new object[] { commonParent }, SelectionTypes.Replace); 1801SelectionService.SetSelectedComponents(new object[] { host.RootComponent }, SelectionTypes.Replace); 1806if (SelectionService.PrimarySelection is null) 1808SelectionService.SetSelectedComponents(new object[] { host.RootComponent }, SelectionTypes.Replace); 1908IComponent? selectedComponent = (IComponent?)SelectionService?.PrimarySelection; 2156SelectionService?.SetSelectedComponents(selectComps.ToArray(), SelectionTypes.Replace); 2189if (site is null || SelectionService is null || !TryGetService(out IDesignerHost? host)) 2191Debug.Assert(SelectionService is not null, "We need the SelectionService, but we can't find it!"); 2222SelectionService.SetSelectedComponents(selComps, SelectionTypes.Replace); 2272if (SelectionService is null) 2282ICollection sel = SelectionService.GetSelectedComponents(); 2288object? selPrimary = SelectionService.PrimarySelection; 2370if (SelectionService is null) 2383ICollection sel = SelectionService.GetSelectedComponents(); 2448object? obj = SelectionService!.PrimarySelection; 2508if (SelectionService is null) 2524ICollection sel = SelectionService.GetSelectedComponents(); 2580object? primary = SelectionService.PrimarySelection; 2882if (SelectionService is null) 2891selCount = SelectionService.SelectionCount; 2901if (baseComponent is not null && SelectionService.GetComponentSelected(baseComponent)) 2907primarySelection = SelectionService.PrimarySelection as IComponent; 2913ICollection selection = SelectionService.GetSelectedComponents();
System\Windows\Forms\Design\ControlCommandSet.cs (11)
295ICollection sel = SelectionService.GetSelectedComponents(); 513ISelectionService selSvc = SelectionService; 935ISelectionService selSvc = SelectionService; 963Debug.Assert(SelectionService is not null, "Need SelectionService for sizing command"); 965if (SelectionService is null) 986ICollection sel = SelectionService.GetSelectedComponents(); 1299Debug.Assert(SelectionService is not null, "Need SelectionService for sizing command"); 1301if (SelectionService is null) 1308ICollection selectedComponents = SelectionService.GetSelectedComponents(); 1361ISelectionService selSvc = SelectionService; 1429ISelectionService selSvc = SelectionService;