Base:
property
Site
System.ComponentModel.Component.Site
Implemented interface member:
property
Site
System.ComponentModel.IComponent.Site
2 overrides of Site
System.Windows.Forms (2)
System\Windows\Forms\ActiveX\AxHost.cs (1)
886
public override ISite?
Site
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.cs (1)
173
public override ISite?
Site
146 writes to Site
System.Windows.Forms (5)
System\Windows\Forms\ActiveX\AxHost.cs (1)
902
base.
Site
= value;
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (2)
1644
_control.
Site
= new AxSourcingSite(_control, _clientSite, "ControlAxSourcingSite");
1648
_control.
Site
= null;
System\Windows\Forms\Controls\ToolStrips\ToolStripControlHost.cs (1)
392
ControlInternal.
Site
= value is not null
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.cs (1)
179
base.
Site
= value;
System.Windows.Forms.Design (2)
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (1)
1103
_dataGridViewPrivateCopy.
Site
= dataGridView.Site;
System\Windows\Forms\Design\ToolStripTemplateNode.cs (1)
1478
_miniToolStrip.
Site
= strip.Site;
System.Windows.Forms.Design.Tests (26)
ControlDesignerTests.cs (2)
212
_designer._control.
Site
= mockSite.Object;
217
childControl.
Site
= mockSite.Object;
SplitContainerDesignerTests.cs (2)
39
splitContainer.
Site
= mockSite.Object;
59
splitContainer.
Site
= mockSite.Object;
System\Windows\Forms\Design\ContextMenuStripActionListTests.cs (2)
39
_toolStripDropDownMenu.
Site
= mockSite.Object;
141
_toolStripDropDown.
Site
= _toolStripDropDownMenu.Site;
System\Windows\Forms\Design\ControlDesigner.DesignerControlCollectionTests.cs (1)
160
control.
Site
= new MockSite(control, designMode: true);
System\Windows\Forms\Design\DataGridViewAddColumnDialogTests.cs (1)
35
_dataGridView.
Site
= mockSite.Object;
System\Windows\Forms\Design\DataGridViewDesignerTests.cs (1)
56
_dataGridView.
Site
= site.Object;
System\Windows\Forms\Design\InheritanceUITests.cs (1)
27
_sitedChildControl = new Control { Parent = _control,
Site
= new Mock<ISite>().Object };
System\Windows\Forms\Design\MaskedTextBoxDesignerActionListTests.cs (1)
35
_maskedTextBox.
Site
= mockSite.Object;
System\Windows\Forms\Design\SplitterPanelDesignerTests.cs (3)
32
toolStripContainer.
Site
= mockSite.Object;
35
splitContainer.
Site
= mockSite.Object;
38
splitterPanel.
Site
= mockSite.Object;
System\Windows\Forms\Design\TextBoxBaseDesignerTests.cs (1)
22
_textbox.
Site
= site.Object;
System\Windows\Forms\Design\ToolStripActionListTests.cs (2)
38
_toolStrip.
Site
= mockSite.Object;
151
Site
= _toolStrip.Site
System\Windows\Forms\Design\ToolStripContainerDesignerTests.cs (1)
33
_toolStripContainer.
Site
= mockSite.Object;
System\Windows\Forms\Design\ToolStripMenuItemCodeDomSerializerTests.cs (1)
63
dropDown.
Site
= mockSite.Object;
System\Windows\Forms\Design\ToolStripPanelDesignerTests.cs (2)
39
ToolStripPanel toolStripPanel = new() {
Site
= _mockSite.Object };
92
toolStripPanel.
Site
= _mockSite.Object;
System\Windows\Forms\Design\UpDownBaseDesignerTests.cs (1)
22
_numericUpDown.
Site
= site.Object;
System\Windows\Forms\Design\UserControlDocumentDesignerTests.cs (1)
72
control.
Site
= mockSite.Object;
TestControlDesigner.Mocks.cs (1)
29
_control.
Site
= _mockSite.Object;
ToolStripDesignerTests.cs (1)
40
toolStrip.
Site
= mockSite.Object;
ToolStripDropDownDesignerTest.cs (1)
35
toolStripDropDown.
Site
= mockSite.Object;
System.Windows.Forms.Tests (113)
System\Windows\Forms\ButtonBaseTests.cs (19)
571
Site
= mockSite.Object,
617
Site
= mockSite.Object,
663
Site
= mockSite.Object,
870
Site
= mockSite.Object,
961
Site
= mockSite.Object
1515
Site
= mockSite.Object
1669
Site
= mockSite.Object
2851
Site
= mockSite.Object,
2963
Site
= mockSite.Object
4397
Site
= mockSite.Object,
4488
Site
= mockSite.Object
5167
Site
= mockSite.Object
5271
Site
= mockSite.Object
6283
Site
= mockSite.Object
6374
Site
= mockSite.Object
6996
Site
= mockSite.Object
7100
Site
= mockSite.Object
7426
Site
= mockSite.Object
7530
Site
= mockSite.Object
System\Windows\Forms\ButtonTests.cs (2)
2426
Site
= mockSite.Object
2515
Site
= mockSite.Object
System\Windows\Forms\ControlTests.Methods.cs (3)
2504
Site
= mockSite.Object
2555
Site
= mockSite.Object
2623
Site
= mockSite.Object
System\Windows\Forms\ControlTests.Properties.cs (20)
9304
Site
= mockSite.Object
9372
Site
= mockSite.Object,
10550
Site
= mockSite.Object
10609
Site
= mockSite.Object
10653
Site
= value
10659
control.
Site
= value;
10677
control.
Site
= value;
10685
control.
Site
= value;
10706
Site
= mockSite.Object
10709
control.
Site
= value;
10713
control.
Site
= value;
10811
control.
Site
= mockSite1.Object;
10827
control.
Site
= mockSite1.Object;
10843
control.
Site
= mockSite2.Object;
10859
control.
Site
= mockSite3.Object;
10875
control.
Site
= mockSite4.Object;
10993
control.
Site
= mockSite1.Object;
11009
control.
Site
= mockSite1.Object;
11025
control.
Site
= mockSite2.Object;
11041
control.
Site
= mockSite3.Object;
System\Windows\Forms\DataGridViewElementTests.cs (1)
288
Site
= mockSite.Object
System\Windows\Forms\MdiClientTests.cs (4)
357
Site
= mockSite.Object,
422
Site
= mockSite.Object,
849
Site
= mockSite.Object
1011
Site
= mockSite.Object
System\Windows\Forms\PanelTests.cs (1)
1089
Site
= mockSite.Object,
System\Windows\Forms\PictureBoxTests.cs (8)
832
Site
= mockSite.Object
847
pictureBox.
Site
= null;
864
Site
= mockSite.Object
877
pictureBox.
Site
= null;
2047
Site
= mockSite.Object
2062
pictureBox.
Site
= null;
2079
Site
= mockSite.Object
2092
pictureBox.
Site
= null;
System\Windows\Forms\ProgressBarTests.cs (3)
149
Site
= mockSite.Object
807
Site
= mockSite.Object,
868
Site
= mockSite.Object,
System\Windows\Forms\TabControl.ControlCollectionTests.cs (6)
665
Site
= mockSite.Object
695
Site
= mockValueSite.Object
699
Site
= mockSite.Object
722
Site
= mockSite.Object
823
Site
= mockSite.Object
1523
Site
= mockSite.Object
System\Windows\Forms\TabControl.TabPageCollectionTests.cs (16)
662
Site
= mockSite.Object
694
Site
= mockValueSite.Object
698
Site
= mockSite.Object
723
Site
= mockSite.Object
829
Site
= mockSite.Object
2617
Site
= mockSite.Object
2647
Site
= mockValueSite.Object
2651
Site
= mockSite.Object
2674
Site
= mockSite.Object
2855
Site
= mockSite.Object
3406
Site
= mockSite.Object
3494
Site
= mockSite.Object
3610
Site
= mockSite.Object
3805
Site
= mockSite.Object
3891
Site
= mockSite.Object
4643
Site
= mockSite.Object
System\Windows\Forms\TabControlTests.cs (1)
207
Site
= mockSite.Object
System\Windows\Forms\TabPageTests.cs (15)
710
Site
= mockSite.Object,
752
Site
= mockSite.Object,
795
Site
= mockSite.Object,
1167
Site
= mockSite.Object
1319
Site
= mockSite.Object
1439
Site
= mockSite.Object
1556
Site
= mockSite.Object
1697
Site
= mockSite.Object
1811
Site
= mockSite.Object
2838
Site
= mockSite.Object
2952
Site
= mockSite.Object
3071
Site
= mockSite.Object
3210
Site
= mockSite.Object
3328
Site
= mockSite.Object
3440
Site
= mockSite.Object
System\Windows\Forms\ToolStripDropDownTests.cs (2)
1227
Site
= mockSite.Object,
1365
Site
= mockSite.Object,
System\Windows\Forms\ToolStripTests.cs (5)
1778
Site
= mockSite.Object,
1914
Site
= mockSite.Object,
2131
Site
= mockSite.Object,
2137
Site
= mockSite.Object,
4259
Site
= mockSite.Object
System\Windows\Forms\TreeViewTests.cs (3)
539
Site
= mockSite.Object,
578
Site
= mockSite.Object,
6109
Site
= mockSite.Object
System\Windows\Forms\UserControlTests.cs (2)
284
Site
= mockSite.Object
376
Site
= mockSite.Object
TextBoxBaseTests.cs (2)
1477
Site
= mockSite.Object,
1508
Site
= mockSite.Object,
397 references to Site
System.Windows.Forms (37)
System\Windows\Forms\ActiveX\AxHost.AxContainer.cs (4)
121
string? name = control.
Site
is { } site ? site.Name : control.Name;
295
if (control.
Site
is not { } site
333
Debug.Assert(_parent.
Site
is null, "Parent is sited but we could not find IContainer");
383
=> _parent.
Site
is { } site && site.DesignMode ? site.Container : null;
System\Windows\Forms\Control.cs (10)
571
ambientProperties =
Site
is not null ?
Site
.GetService<AmbientProperties>() : GetService<AmbientProperties>();
2347
return (control.
Site
is not null && control.
Site
.DesignMode) || control.Parent is null ?
2348
control.
Site
: GetSitedParentSite(control.Parent);
2595
if (string.IsNullOrEmpty(name) &&
Site
is not null)
2597
name =
Site
.Name;
5286
Site
is { } site
11191
MarshalStringToMessage(
Site
?.Name ?? Name ?? string.Empty, ref m);
12614
ISite? site =
Site
;
System\Windows\Forms\Controls\ListView\ListView.cs (1)
6126
ISite? site =
Site
;
System\Windows\Forms\Controls\ListView\ListViewGroupItemCollection.cs (2)
24
public bool OwnerIsDesignMode => _group.ListView?.
Site
is not null && _group.ListView.
Site
.DesignMode;
System\Windows\Forms\Controls\ListView\ListViewItem.cs (2)
1166
if ((_listView.
Site
is null || !_listView.
Site
.DesignMode) && _group is not null)
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.PropertyGridServiceProvider.cs (1)
27
service ??= _ownerPropertyGrid.
Site
?.GetService(serviceType);
System\Windows\Forms\Controls\TabControl\TabControl.ControlCollection.cs (2)
52
ISite? site = _owner.
Site
;
55
ISite? siteTab = tabPage.
Site
;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanel.cs (2)
807
if (toolStripToDrag.
Site
is not null && toolStripToDrag.
Site
.DesignMode && IsHandleCreated)
System\Windows\Forms\Controls\WebBrowser\WebBrowserContainer.cs (3)
312
if (_associatedContainer is not null || ctl.
Site
is not ISite site)
355
=> ctl.
Site
is not null ? ctl.
Site
.Name ?? string.Empty : ctl.Name ?? string.Empty;
System\Windows\Forms\Controls\WebBrowser\WebBrowserHelper.cs (1)
94
ISite? site = ctl.
Site
;
System\Windows\Forms\Layout\Containers\ContainerControl.cs (2)
1118
bool dt =
Site
?.DesignMode ?? false;
1119
bool parentDt = ParentInternal.
Site
?.DesignMode ?? false;
System\Windows\Forms\Layout\FlowLayout.cs (2)
311
if (container is Control flp && flp.
Site
is not null && flp.
Site
.DesignMode)
System\Windows\Forms\MDI\MDIClient.cs (5)
102
ISite? site = ParentInternal?.
Site
;
172
ISite? site = ParentInternal?.
Site
;
224
|| ParentInternal?.
Site
?.DesignMode == true)
333
if (ParentInternal is not null && ParentInternal.
Site
is not null && ParentInternal.
Site
.DesignMode && Handle != IntPtr.Zero)
System.Windows.Forms.Design (129)
System\ComponentModel\Design\ToolStripContainerActionList.cs (1)
25
_serviceProvider = _toolStripContainer.
Site
;
System\Windows\Forms\Design\BaseContextMenuStrip.cs (1)
92
if (parentControl.
Site
is not null)
System\Windows\Forms\Design\Behavior\DropSourceBehavior.cs (5)
80
_serviceProviderSource = source.
Site
;
223
if (c.
Site
is not null && !(c.
Site
is INestedSite) && _destHost is not null)
305
_serviceProviderTarget = dragTarget.
Site
;
643
_serviceProviderTarget = target.
Site
;
System\Windows\Forms\Design\Behavior\TableLayoutPanelBehavior.cs (1)
119
_resizeTransaction = host.CreateTransaction(string.Format(SR.TableLayoutPanelRowColResize, (isColumn ? "Column" : "Row"), _designer.Control.
Site
.Name));
System\Windows\Forms\Design\CommandSet.cs (1)
1792
while (parent is not null && parent.
Site
is null)
System\Windows\Forms\Design\ControlCodeDomSerializer.cs (6)
129
if (control.
Site
is not null && control.
Site
.DesignMode)
280
if (parent is not null && parent.
Site
is not null)
423
if (child.
Site
is null || child.
Site
.Container != control.
Site
!.Container)
System\Windows\Forms\Design\ControlCommandSet.cs (8)
300
if (obj is not Control control || control.
Site
is null)
388
if (currentSnapProp.PropertyType == typeof(bool) && c.
Site
is not null && c.
Site
.Container == container)
1409
if (nextControl is not null && nextControl.
Site
is not null)
1411
controlSiteContainer = DesignerUtils.CheckForNestedContainer(nextControl.
Site
.Container); // ...necessary to support SplitterPanel components
1414
if (nextControl is null || nextControl.
Site
is null || controlSiteContainer != container)
1461
if (ctl.
Site
is not null && ctl.
Site
.Container == ctl.Container)
System\Windows\Forms\Design\ControlDesigner.cs (2)
117
if (control.
Site
is not null)
1120
ISite? site = control.
Site
;
System\Windows\Forms\Design\ControlDesigner.DesignerControlCollection.cs (1)
73
_realCollection[i].
Site
is not null &&
System\Windows\Forms\Design\DataGridViewAddColumnDialog.cs (13)
56
if (_liveDataGridView.
Site
.TryGetService(out IUIService? uiService))
129
_liveDataGridView.
Site
?.Container?.Add(column, column.Name);
133
IUIService? uiService = _liveDataGridView.
Site
?.GetService<IUIService>();
155
IDesignerHost? host = _liveDataGridView.
Site
?.GetService<IDesignerHost>();
520
if (!_liveDataGridView.
Site
.TryGetService(out IComponentChangeService? changeService))
584
IHelpService? helpService = _liveDataGridView.
Site
?.GetService<IHelpService>();
635
if (_liveDataGridView.
Site
.TryGetService(out IDesignerHost? host))
638
nameCreationService = _liveDataGridView.
Site
.GetService<INameCreationService>();
650
IUIService? uiService = _liveDataGridView.
Site
?.GetService<IUIService>();
660
if (!_liveDataGridView.
Site
.TryGetService(out IDesignerHost? host))
770
IDesignerHost? host = _liveDataGridView.
Site
?.GetService<IDesignerHost>();
772
INameCreationService? nameCreationService = _liveDataGridView.
Site
?.GetService<INameCreationService>();
788
IUIService? uiService = _liveDataGridView.
Site
?.GetService<IUIService>();
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (11)
116
ITypeResolutionService? tr = _liveDataGridView?.
Site
?.GetService<ITypeResolutionService>();
182
IComponentChangeService? changeService = _liveDataGridView!.
Site
?.GetService<IComponentChangeService>();
184
IContainer? currentContainer = _liveDataGridView.
Site
?.Container;
280
IUIService? uiService = _liveDataGridView?.
Site
?.GetService<IUIService>();
788
IHelpService? helpService = _liveDataGridView?.
Site
?.GetService<IHelpService>();
795
IUIService? uiService = _liveDataGridView?.
Site
?.GetService<IUIService>();
873
ITypeResolutionService? tr = _liveDataGridView?.
Site
?.GetService<ITypeResolutionService>();
1090
IComponentChangeService? newComponentChangeService = dataGridView.
Site
?.GetService<IComponentChangeService>();
1103
_dataGridViewPrivateCopy.Site = dataGridView.
Site
;
1150
_propertyGrid1.Site = new DataGridViewComponentPropertyGridSite(_liveDataGridView.
Site
, _liveDataGridView);
1308
get => Owner._liveDataGridView?.
Site
;
System\Windows\Forms\Design\DataGridViewColumnDesigner.cs (5)
52
if (dataGridView is not null && dataGridView.
Site
is not null)
54
host = dataGridView.
Site
.GetService<IDesignerHost>();
55
nameCreationService = dataGridView.
Site
.GetService<INameCreationService>();
71
if (dataGridView is not null && dataGridView.
Site
is not null)
73
IUIService? uiService = dataGridView.
Site
.GetService<IUIService>();
System\Windows\Forms\Design\DataGridViewDesigner.cs (16)
42
IComponentChangeService? componentChangeService = dataGridView.
Site
?.GetService<IComponentChangeService>();
97
if (dataGridView.
Site
.TryGetService(out IComponentChangeService? ccs))
341
IContainer? currentContainer = dataGridView.
Site
?.Container;
400
IContainer? currentContainer = dataGridView.
Site
?.Container;
451
ISite? site = dataGridView.
Site
;
532
ISite? site = dataGridView.
Site
;
842
IDesignerHost? host = dataGridView.
Site
?.GetService<IDesignerHost>();
844
IComponentChangeService? changeService = dataGridView.
Site
?.GetService<IComponentChangeService>();
921
IDesignerHost? host = dataGridView.
Site
?.GetService<IDesignerHost>();
936
IComponentChangeService? changeService = dataGridView.
Site
?.GetService<IComponentChangeService>();
964
IDesignerHost? host = dataGridView.
Site
?.GetService<IDesignerHost>();
979
IComponentChangeService? changeService = dataGridView.
Site
?.GetService<IComponentChangeService>();
1007
IDesignerHost? host = dataGridView.
Site
?.GetService<IDesignerHost>();
1022
IComponentChangeService? changeService = dataGridView.
Site
?.GetService<IComponentChangeService>();
1050
IDesignerHost? host = dataGridView.
Site
?.GetService<IDesignerHost>();
1065
IComponentChangeService? changeService = dataGridView.
Site
?.GetService<IComponentChangeService>();
System\Windows\Forms\Design\DesignerToolStripControlHost.cs (1)
39
if (parent.
Site
is not ISite site)
System\Windows\Forms\Design\InheritanceUI.cs (2)
70
if (child.
Site
is null)
95
if (child.
Site
is null)
System\Windows\Forms\Design\ParentControlDesigner.cs (4)
481
if (selectedControl is not null && selectedControl.
Site
is null)
879
child.
Site
is not null && child.
Site
.Container == container)
1276
ReParentControls(Control, selectedControls, string.Format(SR.ParentControlDesignerLassoShortcutRedo, Control.
Site
.Name), host);
System\Windows\Forms\Design\StyleEditorForm.cs (1)
102
var host = _tableLayoutPanel.
Site
.GetService<IDesignerHost>();
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (13)
505
trans = host.CreateTransaction(string.Format(SR.BehaviorServiceCopyControl, control.
Site
.Name));
524
trans = host.CreateTransaction(string.Format(SR.TableLayoutPanelDesignerControlsSwapped, control.
Site
.Name, existingControl.
Site
.Name));
552
trans = host.CreateTransaction(string.Format(SR.BehaviorServiceMoveControl, control.
Site
.Name));
1637
if (host is not null && Table.
Site
is not null)
1642
: SR.TableLayoutPanelDesignerAddColumnUndoUnit, Table.
Site
.Name));
1752
if (host is not null && Table.
Site
is not null)
1757
Table.
Site
.Name));
1876
if (host is not null && Table.
Site
is not null)
1880
Table.
Site
.Name));
1973
if (host is not null && Table.
Site
is not null)
1975
using DesignerTransaction t = host.CreateTransaction(string.Format(SR.TableLayoutPanelDesignerChangeSizeTypeUndoUnit, Table.
Site
.Name));
2211
_realCollection[i].
Site
is not null &&
System\Windows\Forms\Design\TabOrder.cs (2)
383
ISite? site = parent.
Site
;
448
if (control.
Site
is not ISite site || site.Container != _host)
System\Windows\Forms\Design\ToolStripActionList.cs (1)
121
DesignerActionUIService? actionUIService = (DesignerActionUIService?)_toolStrip.
Site
?.GetService(typeof(DesignerActionUIService));
System\Windows\Forms\Design\ToolStripCodeDomSerializer.cs (2)
25
if (item.Site is not null && toolStrip.
Site
is not null && item.Site.Container == toolStrip.
Site
.Container)
System\Windows\Forms\Design\ToolStripCollectionEditor.ToolStripItemEditorForm.cs (1)
815
if (parentStrip is not null && parentStrip.
Site
is not null)
System\Windows\Forms\Design\ToolStripDesigner.cs (2)
201
_toolStripContextMenu ??= new BaseContextMenuStrip(ToolStrip.
Site
)
985
if (addingItem.Owner.
Site
is null)
System\Windows\Forms\Design\ToolStripItemDesigner.cs (4)
286
if (item.Owner.
Site
is not null)
298
if (parentControl.
Site
is not null)
783
if (parent.
Site
is not null)
843
if (parent.
Site
is not null)
System\Windows\Forms\Design\ToolStripKeyboardHandlingService.cs (8)
354
if ((parentControls[c].
Site
is not null && parentControls[c].TabIndex != targetIndex) || hitCtl)
1064
if (selSvc.PrimarySelection is ToolStripDropDown dropDown && dropDown.
Site
is not null)
1402
&& parentToMoveOn.OwnerItem.Owner?.
Site
is not null
1444
&& parentToMoveOn.OwnerItem.Owner?.
Site
is not null
1715
if (!(next is Control nextControl) || nextControl.
Site
is null || nextControl.
Site
.Container != container)
1986
if (ctl.
Site
is not null && ctl.
Site
.Container == container && !(ctl is ToolStripPanel))
System\Windows\Forms\Design\ToolStripMenuItemCodeDomSerializer.cs (1)
40
if (parent is not null && parent.
Site
is null)
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (11)
234
if (mainStrip is not null && mainStrip.
Site
is not null && !(mainStrip is ContextMenuStrip))
728
if (MenuItem.DropDown.
Site
is null)
1160
if (ddi.DropDown.
Site
is not null || ddi.DropDownItems.Count == 1)
1587
if (MenuItem.DropDown.
Site
is not null)
1679
if (IsOnContextMenu && MenuItem.DropDown.
Site
is not null)
1698
if (IsOnContextMenu && MenuItem.DropDown.
Site
is not null)
1716
if (IsOnContextMenu && MenuItem.DropDown.
Site
is not null)
1727
if (IsOnContextMenu && MenuItem.DropDown.
Site
is not null)
1744
if (IsOnContextMenu && MenuItem.DropDown.
Site
is not null)
1756
if (IsOnContextMenu && MenuItem.DropDown.
Site
is not null)
1782
if (IsOnContextMenu && MenuItem.DropDown.
Site
is not null)
System\Windows\Forms\Design\ToolStripTemplateNode.cs (1)
1478
_miniToolStrip.Site = strip.
Site
;
System\Windows\Forms\Design\TreeNodeCollectionEditor.cs (4)
120
if (TreeView is not null && TreeView.
Site
is not null)
122
IDictionaryService dictionaryService = (IDictionaryService)TreeView.
Site
.GetService(typeof(IDictionaryService));
144
if (TreeView is not null && TreeView.
Site
is not null)
146
TreeView.
Site
.TryGetService(out IDictionaryService dictionaryService);
System.Windows.Forms.Design.Tests (4)
ControlDesignerTests.cs (1)
229
Mock<DesignerFrame> mockDesignerFrame = new(_designer._control.
Site
!) { CallBase = true };
System\Windows\Forms\Design\ContextMenuStripActionListTests.cs (1)
141
_toolStripDropDown.Site = _toolStripDropDownMenu.
Site
;
System\Windows\Forms\Design\ToolStripActionListTests.cs (1)
151
Site = _toolStrip.
Site
System\Windows\Forms\Design\ToolStripMenuItemCodeDomSerializerTests.cs (1)
44
mockParent.Setup(p => p.
Site
).Returns((ISite?)null);
System.Windows.Forms.Tests (226)
System\Windows\Forms\ButtonBaseTests.cs (1)
108
Assert.Null(control.
Site
);
System\Windows\Forms\ButtonTests.cs (1)
106
Assert.Null(control.
Site
);
System\Windows\Forms\CheckBoxTests.cs (1)
108
Assert.Null(control.
Site
);
System\Windows\Forms\ComboBoxTests.cs (1)
121
Assert.Null(control.
Site
);
System\Windows\Forms\ContainerControlTests.cs (1)
111
Assert.Null(control.
Site
);
System\Windows\Forms\ControlTests.cs (5)
89
Assert.Null(control.
Site
);
178
Assert.Null(control.
Site
);
274
Assert.Null(control.
Site
);
370
Assert.Null(control.
Site
);
466
Assert.Null(control.
Site
);
System\Windows\Forms\ControlTests.Properties.cs (15)
10655
Assert.Same(value, control.
Site
);
10660
Assert.Same(value, control.
Site
);
10678
Assert.Same(value, control.
Site
);
10686
Assert.Same(value, control.
Site
);
10710
Assert.Same(value, control.
Site
);
10714
Assert.Same(value, control.
Site
);
10812
Assert.Same(mockSite1.Object, control.
Site
);
10828
Assert.Same(mockSite1.Object, control.
Site
);
10844
Assert.Same(mockSite2.Object, control.
Site
);
10860
Assert.Same(mockSite3.Object, control.
Site
);
10876
Assert.Same(mockSite4.Object, control.
Site
);
10994
Assert.Same(mockSite1.Object, control.
Site
);
11010
Assert.Same(mockSite1.Object, control.
Site
);
11026
Assert.Same(mockSite2.Object, control.
Site
);
11042
Assert.Same(mockSite3.Object, control.
Site
);
System\Windows\Forms\DataGridViewTextBoxEditingControlTests.cs (1)
117
Assert.Null(control.
Site
);
System\Windows\Forms\DateTimePickerTests.cs (1)
113
Assert.Null(control.
Site
);
System\Windows\Forms\Design\ComponentEditorFormTests.cs (1)
147
Assert.Null(control.
Site
);
System\Windows\Forms\Design\ComponentEditorPageTests.cs (1)
114
Assert.Null(control.
Site
);
System\Windows\Forms\DomainUpDownTests.cs (1)
137
_sub.
Site
.Should().BeNull();
System\Windows\Forms\FlowLayoutPanelTests.cs (1)
105
Assert.Null(control.
Site
);
System\Windows\Forms\FormTests.cs (1)
149
Assert.Null(control.
Site
);
System\Windows\Forms\GroupBoxTests.cs (1)
93
Assert.Null(control.
Site
);
System\Windows\Forms\HScrollBarTests.cs (1)
105
Assert.Null(control.
Site
);
System\Windows\Forms\LabelTests.cs (1)
102
Assert.Null(control.
Site
);
System\Windows\Forms\ListBoxTests.cs (1)
121
Assert.Null(control.
Site
);
System\Windows\Forms\ListControlTests.cs (1)
101
Assert.Null(control.
Site
);
System\Windows\Forms\ListViewTests.cs (1)
136
Assert.Null(control.
Site
);
System\Windows\Forms\MdiClientTests.cs (1)
78
Assert.Null(control.
Site
);
System\Windows\Forms\MenuStripTests.cs (1)
135
Assert.Null(control.
Site
);
System\Windows\Forms\MonthCalendarTests.cs (1)
127
Assert.Null(control.
Site
);
System\Windows\Forms\PictureBoxTests.cs (1)
100
Assert.Null(control.
Site
);
System\Windows\Forms\ProgressBarTests.cs (1)
91
Assert.Null(control.
Site
);
System\Windows\Forms\RadioButtonTests.cs (1)
106
Assert.Null(control.
Site
);
System\Windows\Forms\RichTextBoxTests.cs (1)
125
Assert.Null(control.
Site
);
System\Windows\Forms\ScrollableControlTests.cs (1)
104
Assert.Null(control.
Site
);
System\Windows\Forms\ScrollBarTests.cs (1)
94
Assert.Null(control.
Site
);
System\Windows\Forms\SplitterTests.cs (1)
94
Assert.Null(control.
Site
);
System\Windows\Forms\StatusStripTests.cs (1)
136
Assert.Null(control.
Site
);
System\Windows\Forms\TabControl.ControlCollectionTests.cs (47)
75
Assert.Null(value1.
Site
);
93
Assert.Null(value1.
Site
);
97
Assert.Null(value2.
Site
);
122
Assert.Null(value1.
Site
);
125
Assert.Null(value2.
Site
);
205
Assert.Null(value1.
Site
);
232
Assert.Null(value1.
Site
);
236
Assert.Null(value2.
Site
);
273
Assert.Null(value1.
Site
);
277
Assert.Null(value2.
Site
);
372
Assert.Null(value1.
Site
);
393
Assert.Null(value1.
Site
);
397
Assert.Null(value2.
Site
);
428
Assert.Null(value1.
Site
);
431
Assert.Null(value2.
Site
);
520
Assert.Null(value1.
Site
);
550
Assert.Null(value1.
Site
);
554
Assert.Null(value2.
Site
);
597
Assert.Null(value1.
Site
);
601
Assert.Null(value2.
Site
);
670
Assert.NotNull(value.
Site
);
704
Assert.Same(mockValueSite.Object, value.
Site
);
727
Assert.Null(value.
Site
);
928
Assert.Null(value1.
Site
);
932
Assert.Null(value2.
Site
);
948
Assert.Null(value1.
Site
);
952
Assert.Null(value2.
Site
);
968
Assert.Null(value1.
Site
);
972
Assert.Null(value2.
Site
);
1040
Assert.Null(value1.
Site
);
1044
Assert.Null(value2.
Site
);
1063
Assert.Null(value1.
Site
);
1067
Assert.Null(value2.
Site
);
1089
Assert.Null(value1.
Site
);
1093
Assert.Null(value2.
Site
);
1158
Assert.Null(value1.
Site
);
1162
Assert.Null(value2.
Site
);
1181
Assert.Null(value1.
Site
);
1185
Assert.Null(value2.
Site
);
1204
Assert.Null(value1.
Site
);
1208
Assert.Null(value2.
Site
);
1277
Assert.Null(value1.
Site
);
1281
Assert.Null(value2.
Site
);
1300
Assert.Null(value1.
Site
);
1304
Assert.Null(value2.
Site
);
1326
Assert.Null(value1.
Site
);
1330
Assert.Null(value2.
Site
);
System\Windows\Forms\TabControl.TabPageCollectionTests.cs (86)
61
Assert.Null(value1.
Site
);
80
Assert.Null(value1.
Site
);
84
Assert.Null(value2.
Site
);
110
Assert.Null(value1.
Site
);
113
Assert.Null(value2.
Site
);
194
Assert.Null(value1.
Site
);
222
Assert.Null(value1.
Site
);
226
Assert.Null(value2.
Site
);
264
Assert.Null(value1.
Site
);
268
Assert.Null(value2.
Site
);
364
Assert.Null(value1.
Site
);
386
Assert.Null(value1.
Site
);
390
Assert.Null(value2.
Site
);
422
Assert.Null(value1.
Site
);
425
Assert.Null(value2.
Site
);
515
Assert.Null(value1.
Site
);
546
Assert.Null(value1.
Site
);
550
Assert.Null(value2.
Site
);
594
Assert.Null(value1.
Site
);
598
Assert.Null(value2.
Site
);
669
Assert.NotNull(value.
Site
);
705
Assert.Same(mockValueSite.Object, value.
Site
);
730
Assert.Null(value.
Site
);
1008
Assert.Null(value1.
Site
);
1026
Assert.Null(value1.
Site
);
1030
Assert.Null(value2.
Site
);
1055
Assert.Null(value1.
Site
);
1058
Assert.Null(value2.
Site
);
2003
Assert.Null(value1.
Site
);
2022
Assert.Null(value1.
Site
);
2026
Assert.Null(value2.
Site
);
2054
Assert.Null(value1.
Site
);
2057
Assert.Null(value2.
Site
);
2131
Assert.Null(value1.
Site
);
2159
Assert.Null(value1.
Site
);
2163
Assert.Null(value2.
Site
);
2203
Assert.Null(value1.
Site
);
2207
Assert.Null(value2.
Site
);
2307
Assert.Null(value1.
Site
);
2329
Assert.Null(value1.
Site
);
2333
Assert.Null(value2.
Site
);
2367
Assert.Null(value1.
Site
);
2370
Assert.Null(value2.
Site
);
2464
Assert.Null(value1.
Site
);
2495
Assert.Null(value1.
Site
);
2499
Assert.Null(value2.
Site
);
2545
Assert.Null(value1.
Site
);
2549
Assert.Null(value2.
Site
);
2622
Assert.NotNull(value.
Site
);
2656
Assert.Same(mockValueSite.Object, value.
Site
);
2679
Assert.Null(value.
Site
);
3049
Assert.Null(value1.
Site
);
3068
Assert.Null(value1.
Site
);
3072
Assert.Null(value2.
Site
);
3100
Assert.Null(value1.
Site
);
3103
Assert.Null(value2.
Site
);
4015
Assert.Null(value1.
Site
);
4019
Assert.Null(value2.
Site
);
4036
Assert.Null(value1.
Site
);
4040
Assert.Null(value2.
Site
);
4057
Assert.Null(value1.
Site
);
4061
Assert.Null(value2.
Site
);
4130
Assert.Null(value1.
Site
);
4134
Assert.Null(value2.
Site
);
4154
Assert.Null(value1.
Site
);
4158
Assert.Null(value2.
Site
);
4181
Assert.Null(value1.
Site
);
4185
Assert.Null(value2.
Site
);
4253
Assert.Null(value1.
Site
);
4257
Assert.Null(value2.
Site
);
4277
Assert.Null(value1.
Site
);
4281
Assert.Null(value2.
Site
);
4301
Assert.Null(value1.
Site
);
4305
Assert.Null(value2.
Site
);
4377
Assert.Null(value1.
Site
);
4381
Assert.Null(value2.
Site
);
4401
Assert.Null(value1.
Site
);
4405
Assert.Null(value2.
Site
);
4428
Assert.Null(value1.
Site
);
4432
Assert.Null(value2.
Site
);
4734
Assert.Null(value1.
Site
);
4738
Assert.Null(value2.
Site
);
4754
Assert.Null(value1.
Site
);
4758
Assert.Null(value2.
Site
);
4774
Assert.Null(value1.
Site
);
4778
Assert.Null(value2.
Site
);
System\Windows\Forms\TabControlTests.cs (1)
101
Assert.Null(control.
Site
);
System\Windows\Forms\TabPageTests.cs (2)
110
Assert.Null(control.
Site
);
219
Assert.Null(control.
Site
);
System\Windows\Forms\ToolStripControlHostTests.cs (31)
1791
Assert.NotSame(mockSite.Object, c.
Site
);
1792
Assert.Same(c, c.
Site
.Component);
1793
Assert.Same(container, c.
Site
.Container);
1794
Assert.Equal(designMode, c.
Site
.DesignMode);
1795
Assert.Equal(name, c.
Site
.Name);
1801
Assert.NotSame(mockSite.Object, c.
Site
);
1802
Assert.Same(c, c.
Site
.Component);
1803
Assert.Same(container, c.
Site
.Container);
1804
Assert.Equal(designMode, c.
Site
.DesignMode);
1805
Assert.Equal(name, c.
Site
.Name);
1811
Assert.Null(c.
Site
);
1830
ISite oldSite = c.
Site
;
1851
ISite oldSite = c.
Site
;
1872
ISite oldSite = c.
Site
;
1901
c.
Site
.Name = value;
1903
Assert.Equal(expected, c.
Site
.Name);
1908
c.
Site
.Name = value;
1910
Assert.Equal(expected, c.
Site
.Name);
1930
ISite oldSite = c.
Site
;
1962
Assert.Same(result, c.
Site
.GetService(typeof(int)));
1981
Assert.Same(c.
Site
, c.
Site
.GetService(typeof(IDictionaryService)));
1999
ISite oldSite = c.
Site
;
2020
Assert.Throws<ArgumentNullException>("service", () => c.
Site
.GetService(null));
2039
IDictionaryService iDictionaryService = Assert.IsAssignableFrom<IDictionaryService>(c.
Site
);
2059
IDictionaryService iDictionaryService = Assert.IsAssignableFrom<IDictionaryService>(c.
Site
);
2081
IDictionaryService iDictionaryService = Assert.IsAssignableFrom<IDictionaryService>(c.
Site
);
2100
IDictionaryService iDictionaryService = Assert.IsAssignableFrom<IDictionaryService>(c.
Site
);
2120
IDictionaryService iDictionaryService = Assert.IsAssignableFrom<IDictionaryService>(c.
Site
);
2140
IDictionaryService iDictionaryService = Assert.IsAssignableFrom<IDictionaryService>(c.
Site
);
2172
IDictionaryService iDictionaryService = Assert.IsAssignableFrom<IDictionaryService>(c.
Site
);
System\Windows\Forms\ToolStripDropDownTests.cs (1)
143
Assert.Null(control.
Site
);
System\Windows\Forms\ToolStripPanelTests.cs (1)
108
Assert.Null(control.
Site
);
System\Windows\Forms\ToolStripTests.cs (2)
151
Assert.Null(control.
Site
);
306
Assert.Null(control.
Site
);
System\Windows\Forms\TreeViewTests.cs (1)
116
Assert.Null(control.
Site
);
System\Windows\Forms\UpDownBaseTests.cs (1)
120
Assert.Null(control.
Site
);
System\Windows\Forms\UserControlTests.cs (1)
111
Assert.Null(control.
Site
);
System\Windows\Forms\VScrollBarTests.cs (1)
104
Assert.Null(control.
Site
);
TextBoxTests.cs (1)
110
Assert.Null(control.
Site
);
TrackBarTests.cs (1)
97
Assert.Null(control.
Site
);
System.Windows.Forms.UI.IntegrationTests (1)
DesignBehaviorsTests.cs (1)
327
pe.Graphics.DrawString($"Design time \n{Control.
Site
?.Name} !", Control.Font, SystemBrushes.WindowText, new PointF(12, 12));