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