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