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)
447
SelectedObject = isurf.GetIDesignerHost().
RootComponent
DesignSurfaceExt (8)
DesignSurfaceExt.cs (7)
95
if (host.
RootComponent
is not null)
114
Type hostType = host.
RootComponent
.GetType();
123
pdS?.SetValue(ihost.
RootComponent
, controlSize);
133
pdS?.SetValue(ihost.
RootComponent
, controlSize);
146
return (TControl)ihost.
RootComponent
;
180
((Control)newComp).Parent = host.
RootComponent
as Control;
205
|| host.
RootComponent
is null
TabOrderHooker.cs (1)
18
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)
1990
if (Site.TryGetService(out IDesignerHost? host) && host.
RootComponent
is ContainerControl rootControl)
System\Windows\Forms\Control.cs (1)
5289
&& 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)
308
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)
19
.Setup(h => h.
RootComponent
)
System\ComponentModel\Design\ComponentDesignerTests.cs (34)
59
.Setup(h => h.
RootComponent
)
86
.Setup(h => h.
RootComponent
)
109
.Setup(h => h.
RootComponent
)
147
.Setup(h => h.
RootComponent
)
312
.Setup(h => h.
RootComponent
)
323
mockDesignerHost.Verify(h => h.
RootComponent
, Times.Once());
327
mockDesignerHost.Verify(h => h.
RootComponent
, Times.Exactly(2));
332
mockDesignerHost.Verify(h => h.
RootComponent
, Times.Exactly(3));
342
.Setup(h => h.
RootComponent
)
348
mockDesignerHost.Verify(h => h.
RootComponent
, Times.Once());
352
mockDesignerHost.Verify(h => h.
RootComponent
, Times.Exactly(2));
357
mockDesignerHost.Verify(h => h.
RootComponent
, Times.Exactly(3));
397
.Setup(h => h.
RootComponent
)
412
mockDesignerHost.Verify(h => h.
RootComponent
, Times.Once());
417
mockDesignerHost.Verify(h => h.
RootComponent
, Times.Exactly(2));
423
mockDesignerHost.Verify(h => h.
RootComponent
, Times.Exactly(3));
435
.Setup(h => h.
RootComponent
)
441
mockDesignerHost.Verify(h => h.
RootComponent
, Times.Once());
445
mockDesignerHost.Verify(h => h.
RootComponent
, Times.Exactly(2));
450
mockDesignerHost.Verify(h => h.
RootComponent
, Times.Exactly(3));
485
.Setup(h => h.
RootComponent
)
797
.Setup(h => h.
RootComponent
)
912
.Setup(h => h.
RootComponent
)
1021
.Setup(h => h.
RootComponent
)
1129
.Setup(h => h.
RootComponent
)
1222
.Setup(h => h.
RootComponent
)
1313
.Setup(h => h.
RootComponent
)
1407
.Setup(h => h.
RootComponent
)
1514
.Setup(h => h.
RootComponent
)
1612
.Setup(h => h.
RootComponent
)
1695
.Setup(h => h.
RootComponent
)
2026
.Setup(h => h.
RootComponent
)
2074
.Setup(h => h.
RootComponent
)
2080
.Setup(h => h.
RootComponent
)
System\ComponentModel\Design\DesignerHostTests.cs (16)
129
Assert.Null(host.
RootComponent
);
284
Assert.Same(component1, host.
RootComponent
);
295
Assert.Same(component1, host.
RootComponent
);
306
Assert.Same(component1, host.
RootComponent
);
317
Assert.Same(component1, host.
RootComponent
);
339
Assert.Same(component1, host.
RootComponent
);
351
Assert.Same(component1, host.
RootComponent
);
362
Assert.Same(component1, host.
RootComponent
);
373
Assert.Same(component1, host.
RootComponent
);
1355
Assert.Null(host.
RootComponent
);
1360
Assert.Same(component, host.
RootComponent
);
1365
Assert.Same(component, host.
RootComponent
);
2229
Assert.Null(host.
RootComponent
);
2537
Assert.Null(host.
RootComponent
);
2549
Assert.Null(host.
RootComponent
);
2561
Assert.Null(host.
RootComponent
);
System\ComponentModel\Design\DesignSurfaceTests.cs (7)
28
Assert.Null(surface.Host.
RootComponent
);
67
Assert.Null(surface.Host.
RootComponent
);
89
Assert.IsType<RootDesignerComponent>(surface.Host.
RootComponent
);
111
Assert.IsType<RootDesignerComponent>(surface.Host.
RootComponent
);
158
Assert.IsType<RootDesignerComponent>(surface.Host.
RootComponent
);
425
Assert.Null(host.
RootComponent
);
937
Assert.IsType<RootDesignerComponent>(host.
RootComponent
);
System\ComponentModel\Design\SiteNestedContainerTests.cs (11)
186
Assert.Same(component1, host.
RootComponent
);
197
Assert.Same(component1, host.
RootComponent
);
208
Assert.Same(component1, host.
RootComponent
);
219
Assert.Same(component1, host.
RootComponent
);
243
Assert.Same(component1, host.
RootComponent
);
255
Assert.Same(component1, host.
RootComponent
);
266
Assert.Same(component1, host.
RootComponent
);
277
Assert.Same(component1, host.
RootComponent
);
679
Assert.Null(host.
RootComponent
);
689
Assert.Null(host.
RootComponent
);
699
Assert.Null(host.
RootComponent
);
TestControlDesigner.Mocks.cs (1)
19
.Setup(h => h.
RootComponent
)
ToolStripDesignerTests.cs (1)
25
.Setup(h => h.
RootComponent
)
ToolStripDropDownDesignerTest.cs (1)
23
.Setup(h => h.
RootComponent
)
ToolStripMenuItemDesignerTest.cs (2)
103
.Setup(h => h.
RootComponent
)
132
.Setup(h => h.
RootComponent
)
System.Windows.Forms.Tests (8)
System\Windows\Forms\ControlTests.Methods.cs (5)
2523
.Setup(s => s.
RootComponent
)
2529
.Setup(s => s.
RootComponent
)
2626
.Setup(h => h.
RootComponent
)
2631
mockDesignerHost.Verify(h => h.
RootComponent
, Times.Once());
2637
mockDesignerHost.Verify(h => h.
RootComponent
, Times.Exactly(2));
System\Windows\Forms\ErrorProviderTests.cs (3)
729
.Setup(h => h.
RootComponent
)
741
mockDesignerHost.Verify(h => h.
RootComponent
, Times.Once());
745
mockDesignerHost.Verify(h => h.
RootComponent
, Times.Once());