2 writes to SelectionService
System.Windows.Forms.Design (2)
System\Windows\Forms\Design\CommandSet.cs (2)
200SelectionService = site.GetService<ISelectionService>(); 367SelectionService = null;
63 references to SelectionService
System.Windows.Forms.Design (63)
System\Windows\Forms\Design\CommandSet.cs (52)
201Debug.Assert(SelectionService is not null, "CommandSet relies on the selection service, which is unavailable."); 202if (SelectionService is not null) 204SelectionService.SelectionChanged += OnSelectionChanged; 364if (SelectionService is not null) 366SelectionService.SelectionChanged -= OnSelectionChanged; 480ICollection selectedComponents = SelectionService!.GetSelectedComponents(); 715if (SelectionService?.PrimarySelection is IComponent pri) 734if (SelectionService?.PrimarySelection is IComponent comp && TryGetService(out IDesignerHost? host) && 783DesignerTransaction trans = SelectionService.SelectionCount > 1 784? host.CreateTransaction(string.Format(SR.DragDropMoveComponents, SelectionService.SelectionCount)) 807List<IComponent> selComps = SelectionService.GetSelectedComponents().Cast<IComponent>().ToList(); 915foreach (IComponent component in SelectionService.GetSelectedComponents()) 934if (component == SelectionService.PrimarySelection) 972if (SelectionService is null) 983ICollection comps = SelectionService.GetSelectedComponents(); 1120if (SelectionService is null) 1130ICollection selectedComponents = SelectionService.GetSelectedComponents(); 1240if (SelectionService is null) 1251ICollection selectedComponents = SelectionService.GetSelectedComponents(); 1390if (SelectionService is null) 1435if (SelectionService is null) 1478SelectionService.SetSelectedComponents(Array.Empty<object>(), SelectionTypes.Replace); 1558SelectionService.SetSelectedComponents(new object[] { commonParent }, SelectionTypes.Replace); 1560else if (SelectionService.PrimarySelection is null) 1562SelectionService.SetSelectedComponents(new object[] { host.RootComponent }, SelectionTypes.Replace); 1583if (site is null || SelectionService is null || !TryGetService(out IDesignerHost? host)) 1595ICollection comps = SelectionService.GetSelectedComponents(); 1606SelectionService.SetSelectedComponents(Array.Empty<object>(), SelectionTypes.Replace); 1768if (commonParent is not null && SelectionService.PrimarySelection is null) 1803SelectionService.SetSelectedComponents(new object[] { commonParent }, SelectionTypes.Replace); 1807SelectionService.SetSelectedComponents(new object[] { host.RootComponent }, SelectionTypes.Replace); 1812if (SelectionService.PrimarySelection is null) 1814SelectionService.SetSelectedComponents(new object[] { host.RootComponent }, SelectionTypes.Replace); 1914IComponent? selectedComponent = (IComponent?)SelectionService?.PrimarySelection; 2162SelectionService?.SetSelectedComponents(selectComps.ToArray(), SelectionTypes.Replace); 2195if (site is null || SelectionService is null || !TryGetService(out IDesignerHost? host)) 2197Debug.Assert(SelectionService is not null, "We need the SelectionService, but we can't find it!"); 2228SelectionService.SetSelectedComponents(selComps, SelectionTypes.Replace); 2278if (SelectionService is null) 2288ICollection sel = SelectionService.GetSelectedComponents(); 2294object? selPrimary = SelectionService.PrimarySelection; 2376if (SelectionService is null) 2389ICollection sel = SelectionService.GetSelectedComponents(); 2454object? obj = SelectionService!.PrimarySelection; 2514if (SelectionService is null) 2530ICollection sel = SelectionService.GetSelectedComponents(); 2586object? primary = SelectionService.PrimarySelection; 2888if (SelectionService is null) 2897selCount = SelectionService.SelectionCount; 2907if (baseComponent is not null && SelectionService.GetComponentSelected(baseComponent)) 2913primarySelection = SelectionService.PrimarySelection as IComponent; 2919ICollection selection = SelectionService.GetSelectedComponents();
System\Windows\Forms\Design\ControlCommandSet.cs (11)
295ICollection sel = SelectionService.GetSelectedComponents(); 516ISelectionService selSvc = SelectionService; 941ISelectionService selSvc = SelectionService; 969Debug.Assert(SelectionService is not null, "Need SelectionService for sizing command"); 971if (SelectionService is null) 992ICollection sel = SelectionService.GetSelectedComponents(); 1305Debug.Assert(SelectionService is not null, "Need SelectionService for sizing command"); 1307if (SelectionService is null) 1314ICollection selectedComponents = SelectionService.GetSelectedComponents(); 1367ISelectionService selSvc = SelectionService; 1435ISelectionService selSvc = SelectionService;