1 implementation of RootComponent
System.Windows.Forms.Design (1)
System\ComponentModel\Design\DesignerHost.cs (1)
873
IComponent IDesignerHost.
RootComponent
=> _rootComponent!;
206 references to RootComponent
DesignSurface (1)
MainForm.cs (1)
439
SelectedObject = isurf.GetIDesignerHost().
RootComponent
DesignSurfaceExt (8)
DesignSurfaceExt.cs (7)
102
if (host.
RootComponent
is not null)
121
Type hostType = host.
RootComponent
.GetType();
130
pdS?.SetValue(ihost.
RootComponent
, controlSize);
140
pdS?.SetValue(ihost.
RootComponent
, controlSize);
153
return (TControl)ihost.
RootComponent
;
187
((Control)newComp).Parent = host.
RootComponent
as Control;
212
|| host.
RootComponent
is null
TabOrderHooker.cs (1)
21
if (host.
RootComponent
is null)
System.ComponentModel.TypeConverter (1)
System\Timers\Timer.cs (1)
223
object? baseComponent = host?.
RootComponent
;
System.Windows.Forms (4)
System\Windows\Forms\ActiveX\AxHost.cs (1)
1989
if (Site.TryGetService(out IDesignerHost? host) && host.
RootComponent
is ContainerControl rootControl)
System\Windows\Forms\Control.cs (1)
5250
&& host.
RootComponent
== this))
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.cs (1)
1140
if (Site.TryGetService(out IDesignerHost? host) && host.
RootComponent
is ContainerControl rootContainerControl)
System\Windows\Forms\ErrorProvider\ErrorProvider.cs (1)
100
if (host.
RootComponent
is ContainerControl rootContainer)
System.Windows.Forms.Design (110)
System\ComponentModel\Design\ComponentDesigner.cs (5)
82
IComponent? root = GetService<IDesignerHost>()?.
RootComponent
;
368
return TryGetService(out IDesignerHost? host) && _component == host.
RootComponent
;
383
bool isRoot = TryGetService(out IDesignerHost? host) && component == host.
RootComponent
;
473
IComponent? rootComponent = GetService<IDesignerHost>()?.
RootComponent
;
497
IComponent? rootComponent = GetService<IDesignerHost>()?.
RootComponent
;
System\ComponentModel\Design\DesignSurface.cs (2)
130
IComponent? rootComponent = ((IDesignerHost)_host).
RootComponent
;
443
IComponent? rootComponent = ((IDesignerHost)_host).
RootComponent
;
System\ComponentModel\Design\MenuCommandService.cs (1)
202
useGlobalVerbs = (selectedComponent == designerHost.
RootComponent
);
System\ComponentModel\Design\SelectionService.cs (1)
223
if (GetService(typeof(IDesignerHost)) is IDesignerHost host && _selection.Contains(host.
RootComponent
))
System\ComponentModel\Design\Serialization\BasicDesignerLoader.cs (2)
301
if (host?.
RootComponent
is not null)
640
lh2.CanReloadWithErrors = LoaderHost.
RootComponent
is not null;
System\ComponentModel\Design\Serialization\CodeDomDesignerLoader.cs (4)
798
Debug.Assert(_rootSerializer is not null || _typeSerializer is not null, $"What are we saving right now? Base component has no serializer: {LoaderHost.
RootComponent
.GetType().FullName}");
802
typeDeclaration = _rootSerializer.Serialize(manager, LoaderHost.
RootComponent
) as CodeTypeDeclaration;
807
typeDeclaration = _typeSerializer.Serialize(manager, LoaderHost.
RootComponent
, LoaderHost.Container.Components);
853
if (LoaderHost.
RootComponent
== component)
System\ComponentModel\Design\Serialization\CodeDomDesignerLoader.ModifiersExtenderProvider.cs (1)
53
return _host?.
RootComponent
;
System\ComponentModel\Design\Serialization\CodeDomDesignerLoader.ModifiersInheritedExtenderProvider.cs (1)
60
return _host?.
RootComponent
;
System\ComponentModel\Design\Serialization\CodeDomLocalizationProvider.LanguageExtenders.cs (3)
73
if (_host is not null && _host.
RootComponent
!= _lastRoot)
75
_lastRoot = _host.
RootComponent
;
225
return (_host is not null && o == _host.
RootComponent
);
System\ComponentModel\Design\ToolStripContainerActionList.cs (4)
100
=> _designerHost?.
RootComponent
is Control root
116
if (_designerHost.
RootComponent
is Control root && _toolStripContainer.Parent is null)
135
if (_designerHost?.
RootComponent
is not Control root
327
string displayName = _designerHost?.
RootComponent
is UserControl
System\Windows\Forms\Design\BaseContextMenuStrip.cs (1)
85
IComponent root = host.
RootComponent
;
System\Windows\Forms\Design\Behavior\DragAssistanceManager.cs (1)
531
Control rootControl = (Control)host.
RootComponent
;
System\Windows\Forms\Design\Behavior\SelectionManager.cs (1)
59
_rootComponent = (Control)_designerHost.
RootComponent
;
System\Windows\Forms\Design\Behavior\ToolboxItemSnapLineBehavior.cs (1)
347
Control baseControl = host.
RootComponent
as Control;
System\Windows\Forms\Design\ChangeToolStripParentVerb.cs (1)
41
Control root = _host.
RootComponent
as Control;
System\Windows\Forms\Design\CommandSet.cs (17)
603
IComponent currentSnapComponent = host.
RootComponent
;
1140
if (host.
RootComponent
is Control baseComponent)
1487
if (obj == host.
RootComponent
|| obj is not Control c)
1512
if (obj == host.
RootComponent
|| obj is not IComponent component)
1562
SelectionService.SetSelectedComponents(new object[] { host.
RootComponent
}, SelectionTypes.Replace);
1642
if (obj == host.
RootComponent
)
1807
SelectionService.SetSelectedComponents(new object[] { host.
RootComponent
}, SelectionTypes.Replace);
1814
SelectionService.SetSelectedComponents(new object[] { host.
RootComponent
}, SelectionTypes.Replace);
1913
IComponent baseComponent = host.
RootComponent
;
2216
IComponent baseComp = host.
RootComponent
;
2252
IComponent baseComponent = host.
RootComponent
;
2401
IComponent baseComponent = host.
RootComponent
;
2485
IComponent baseComponent = host.
RootComponent
;
2538
IComponent baseComponent = host.
RootComponent
;
2906
object baseComponent = designerHost.
RootComponent
;
2999
object baseComp = host.
RootComponent
;
3343
IComponent? baseComponent = host?.
RootComponent
;
System\Windows\Forms\Design\ComponentTray.cs (3)
1079
IDesigner designer = host.GetDesigner(host.
RootComponent
);
1696
if (host is not null && host.
RootComponent
is not null)
1698
if (host.GetDesigner(host.
RootComponent
) is IRootDesigner rd)
System\Windows\Forms\Design\ControlCodeDomSerializer.cs (4)
181
if (TypeDescriptorHelper.TryGetPropertyValue(host.
RootComponent
, "Localizable", out bool b) && b)
193
if ((host is not null && control == host.
RootComponent
) || HasSitedNonReadonlyChildren(control))
228
if (control == host.
RootComponent
)
284
if (parent == host.
RootComponent
)
System\Windows\Forms\Design\ControlCommandSet.cs (10)
281
Control comp = host.
RootComponent
as Control;
402
currentSnapComponent ??= host.
RootComponent
;
945
object baseComp = host.
RootComponent
;
1255
&& host.
RootComponent
is Control baseComponent
1272
&& host.
RootComponent
is Control baseComponent
1297
object baseComp = host.
RootComponent
;
1370
if (selSvc is null || host is null || !(host.
RootComponent
is Control))
1385
current = (Control)host.
RootComponent
;
1437
if (selSvc is null || host is null || !(host.
RootComponent
is Control))
1442
baseCtl = (Control)host.
RootComponent
;
System\Windows\Forms\Design\ControlDesigner.cs (7)
217
if (AutoResizeHandles && Component != _host?.
RootComponent
)
375
return TryGetService(out IDesignerHost? host) && Component == host.
RootComponent
;
688
if (parent is not null && _host is not null && _host.
RootComponent
!= Component)
972
&& _host.
RootComponent
!= component
981
if ((_host is null || _host.
RootComponent
!= component) && ForceVisible)
2172
if (_host is not null && _host.
RootComponent
is not null && _host.GetDesigner(_host.
RootComponent
) is IRootDesigner rd)
System\Windows\Forms\Design\DataGridViewColumnDesigner.cs (1)
288
return _initializing ? (Component != host.
RootComponent
) // for non root components, respect the name that the base Control serialized unless changed
System\Windows\Forms\Design\DesignBindingPicker.cs (3)
529
if (_designerHost is not null && _designerHost.
RootComponent
is not null && _designerHost.
RootComponent
.Site is not null)
531
_instancesNode = new InstancesNode(_designerHost?.
RootComponent
.Site.Name);
System\Windows\Forms\Design\DesignerExtenders.NameExtenderProvider.cs (1)
37
_baseComponent = host.
RootComponent
;
System\Windows\Forms\Design\DocumentDesigner.cs (1)
859
if (host.
RootComponent
is Control root)
System\Windows\Forms\Design\OleDragDropHandler.cs (2)
169
if (host is not null && CurrentlyLocalizing(host.
RootComponent
))
668
IContainer? container = host.
RootComponent
.Site!.Container;
System\Windows\Forms\Design\ParentControlDesigner.cs (4)
548
Control rootControl = host.
RootComponent
as Control;
1001
if (parent is not null && host is not null && host.
RootComponent
!= Component)
1494
DocumentDesigner parentDesigner = host.GetDesigner(host.
RootComponent
) as DocumentDesigner;
1677
if (host?.GetDesigner(host.
RootComponent
) is DocumentDesigner parentDesigner)
System\Windows\Forms\Design\SelectionUIHandler.cs (1)
338
if (controls[i] == host.
RootComponent
)
System\Windows\Forms\Design\TableLayoutPanelCodeDomSerializer.cs (1)
71
if (TypeDescriptorHelper.TryGetPropertyValue(host.
RootComponent
, "Localizable", out bool b))
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (2)
96
PropertyDescriptor prop = TypeDescriptor.GetProperties(host.
RootComponent
)["Localizable"];
99
return (bool)prop.GetValue(host.
RootComponent
);
System\Windows\Forms\Design\TabOrder.cs (4)
238
Control baseControl = (Control)_host.
RootComponent
;
296
Control rootControl = (Control)_host.
RootComponent
;
658
GetTabbing((Control)_host.
RootComponent
, _tabControls);
728
Control form = (Control)_host.
RootComponent
;
System\Windows\Forms\Design\ToolStripContainerDesigner.cs (1)
329
if ((component == _designerHost.
RootComponent
) || !glyphBounds.IntersectsWith(controlBounds))
System\Windows\Forms\Design\ToolStripDesigner.cs (1)
1474
Form parentForm = _host.
RootComponent
as Form;
System\Windows\Forms\Design\ToolStripDropDownDesigner.cs (5)
168
IComponent rootComponent = _host.
RootComponent
;
270
if (_host.
RootComponent
is Control form)
301
if (_host.
RootComponent
is not Control)
372
_selectionService.SetSelectedComponents(new IComponent[] { _host.
RootComponent
}, SelectionTypes.Replace);
389
if (_host.
RootComponent
is Control form)
System\Windows\Forms\Design\ToolStripItemDesigner.cs (2)
252
IComponent root = designerHost.
RootComponent
;
433
if (designerHost.
RootComponent
is Control parent)
System\Windows\Forms\Design\ToolStripKeyboardHandlingService.cs (7)
1066
selSvc.SetSelectedComponents(new object[] { Host.
RootComponent
}, SelectionTypes.Replace);
1189
|| host.
RootComponent
is not Control)
1304
|| host.
RootComponent
is not Control)
1673
if (selSvc is null || host is null || !(host.
RootComponent
is Control))
1695
current = (Control)host.
RootComponent
;
1764
if (selSvc is null || host is null || !(host.
RootComponent
is Control))
1770
baseCtl = (Control)host.
RootComponent
;
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (2)
1131
if (_designerHost.GetDesigner(_designerHost.
RootComponent
) is ControlDesigner designer)
1199
if (_designerHost.GetDesigner(_designerHost.
RootComponent
) is ControlDesigner designer)
System\Windows\Forms\Design\ToolStripTemplateNode.cs (2)
915
baseComponent = (Control)_designerHost.
RootComponent
;
995
Control baseComponent = (Control)_designerHost.
RootComponent
;
System.Windows.Forms.Design.Tests (74)
SplitContainerDesignerTests.cs (1)
17
.Setup(h => h.
RootComponent
)
System\ComponentModel\Design\ComponentDesignerTests.cs (34)
57
.Setup(h => h.
RootComponent
)
84
.Setup(h => h.
RootComponent
)
107
.Setup(h => h.
RootComponent
)
145
.Setup(h => h.
RootComponent
)
310
.Setup(h => h.
RootComponent
)
321
mockDesignerHost.Verify(h => h.
RootComponent
, Times.Once());
325
mockDesignerHost.Verify(h => h.
RootComponent
, Times.Exactly(2));
330
mockDesignerHost.Verify(h => h.
RootComponent
, Times.Exactly(3));
340
.Setup(h => h.
RootComponent
)
346
mockDesignerHost.Verify(h => h.
RootComponent
, Times.Once());
350
mockDesignerHost.Verify(h => h.
RootComponent
, Times.Exactly(2));
355
mockDesignerHost.Verify(h => h.
RootComponent
, Times.Exactly(3));
395
.Setup(h => h.
RootComponent
)
410
mockDesignerHost.Verify(h => h.
RootComponent
, Times.Once());
415
mockDesignerHost.Verify(h => h.
RootComponent
, Times.Exactly(2));
421
mockDesignerHost.Verify(h => h.
RootComponent
, Times.Exactly(3));
433
.Setup(h => h.
RootComponent
)
439
mockDesignerHost.Verify(h => h.
RootComponent
, Times.Once());
443
mockDesignerHost.Verify(h => h.
RootComponent
, Times.Exactly(2));
448
mockDesignerHost.Verify(h => h.
RootComponent
, Times.Exactly(3));
483
.Setup(h => h.
RootComponent
)
795
.Setup(h => h.
RootComponent
)
910
.Setup(h => h.
RootComponent
)
1019
.Setup(h => h.
RootComponent
)
1127
.Setup(h => h.
RootComponent
)
1220
.Setup(h => h.
RootComponent
)
1311
.Setup(h => h.
RootComponent
)
1405
.Setup(h => h.
RootComponent
)
1512
.Setup(h => h.
RootComponent
)
1610
.Setup(h => h.
RootComponent
)
1693
.Setup(h => h.
RootComponent
)
2024
.Setup(h => h.
RootComponent
)
2072
.Setup(h => h.
RootComponent
)
2078
.Setup(h => h.
RootComponent
)
System\ComponentModel\Design\DesignerHostTests.cs (16)
127
Assert.Null(host.
RootComponent
);
282
Assert.Same(component1, host.
RootComponent
);
293
Assert.Same(component1, host.
RootComponent
);
304
Assert.Same(component1, host.
RootComponent
);
315
Assert.Same(component1, host.
RootComponent
);
337
Assert.Same(component1, host.
RootComponent
);
349
Assert.Same(component1, host.
RootComponent
);
360
Assert.Same(component1, host.
RootComponent
);
371
Assert.Same(component1, host.
RootComponent
);
1353
Assert.Null(host.
RootComponent
);
1358
Assert.Same(component, host.
RootComponent
);
1363
Assert.Same(component, host.
RootComponent
);
2227
Assert.Null(host.
RootComponent
);
2535
Assert.Null(host.
RootComponent
);
2547
Assert.Null(host.
RootComponent
);
2559
Assert.Null(host.
RootComponent
);
System\ComponentModel\Design\DesignSurfaceTests.cs (7)
26
Assert.Null(surface.Host.
RootComponent
);
65
Assert.Null(surface.Host.
RootComponent
);
87
Assert.IsType<RootDesignerComponent>(surface.Host.
RootComponent
);
109
Assert.IsType<RootDesignerComponent>(surface.Host.
RootComponent
);
156
Assert.IsType<RootDesignerComponent>(surface.Host.
RootComponent
);
423
Assert.Null(host.
RootComponent
);
935
Assert.IsType<RootDesignerComponent>(host.
RootComponent
);
System\ComponentModel\Design\SiteNestedContainerTests.cs (11)
184
Assert.Same(component1, host.
RootComponent
);
195
Assert.Same(component1, host.
RootComponent
);
206
Assert.Same(component1, host.
RootComponent
);
217
Assert.Same(component1, host.
RootComponent
);
241
Assert.Same(component1, host.
RootComponent
);
253
Assert.Same(component1, host.
RootComponent
);
264
Assert.Same(component1, host.
RootComponent
);
275
Assert.Same(component1, host.
RootComponent
);
677
Assert.Null(host.
RootComponent
);
687
Assert.Null(host.
RootComponent
);
697
Assert.Null(host.
RootComponent
);
TestControlDesigner.Mocks.cs (1)
21
.Setup(h => h.
RootComponent
)
ToolStripDesignerTests.cs (1)
23
.Setup(h => h.
RootComponent
)
ToolStripDropDownDesignerTest.cs (1)
21
.Setup(h => h.
RootComponent
)
ToolStripMenuItemDesignerTest.cs (2)
101
.Setup(h => h.
RootComponent
)
130
.Setup(h => h.
RootComponent
)
System.Windows.Forms.Tests (8)
System\Windows\Forms\ControlTests.Methods.cs (5)
2554
.Setup(s => s.
RootComponent
)
2560
.Setup(s => s.
RootComponent
)
2657
.Setup(h => h.
RootComponent
)
2662
mockDesignerHost.Verify(h => h.
RootComponent
, Times.Once());
2668
mockDesignerHost.Verify(h => h.
RootComponent
, Times.Exactly(2));
System\Windows\Forms\ErrorProviderTests.cs (3)
727
.Setup(h => h.
RootComponent
)
739
mockDesignerHost.Verify(h => h.
RootComponent
, Times.Once());
743
mockDesignerHost.Verify(h => h.
RootComponent
, Times.Once());