16 writes to OwnerItem
System.Windows.Forms (2)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownItem.cs (2)
529
DropDown.
OwnerItem
= null;
718
_dropDown.
OwnerItem
= this;
System.Windows.Forms.Design (2)
System\Windows\Forms\Design\ToolStripDropDownDesigner.cs (1)
666
_menuItem.DropDown.
OwnerItem
= _menuItem;
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (1)
191
MenuItem.DropDown.
OwnerItem
= MenuItem;
System.Windows.Forms.Tests (12)
System\Windows\Forms\ToolStripDropDownTests.cs (6)
2348
OwnerItem
= ownerItem
2369
OwnerItem
= ownerItem
3738
OwnerItem
= ownerItem
3767
OwnerItem
= ownerItem
4623
OwnerItem
= ownerItem
4652
OwnerItem
= ownerItem
System\Windows\Forms\ToolStripItemTests.cs (6)
6650
OwnerItem
= result
6676
OwnerItem
= result
6691
OwnerItem
= ownerItem
6696
OwnerItem
= parentItem
14315
OwnerItem
= ownerItem
14337
OwnerItem
= ownerItem
124 references to OwnerItem
System.Windows.Forms (45)
System\Windows\Forms\Controls\Menus\MenuTimer.cs (1)
149
ToolStripMenuItem? menuItem = toolStrip.ActiveDropDowns[0].
OwnerItem
as ToolStripMenuItem;
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (6)
2103
if (dropDown?.
OwnerItem
is not null && dropDown.
OwnerItem
.IsInDesignMode)
2135
if (this is ToolStripDropDown dropDown && dropDown.
OwnerItem
is not null && (dropDown.
OwnerItem
.IsInDesignMode || (dropDown.
OwnerItem
.Owner is not null && dropDown.
OwnerItem
.Owner.IsInDesignMode)))
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.cs (21)
365
return IsAutoGenerated &&
OwnerItem
is not null ?
OwnerItem
.Font : base.Font;
632
get { return
OwnerItem
as ToolStripDropDownItem; }
707
if (
OwnerItem
is not null)
709
return
OwnerItem
.RightToLeft;
1060
return (topmost.
OwnerItem
is null) ? null : topmost.OwnerToolStrip;
1066
return topmost.
OwnerItem
;
1213
if (OwnerToolStrip is not null &&
OwnerItem
is not null)
1215
if (
OwnerItem
.Bounds.Contains(WindowsFormsUtils.TranslatePoint(mea.Location, this, OwnerToolStrip)))
1231
if (IsAutoGenerated &&
OwnerItem
is not null)
1233
using (new LayoutTransaction(this,
OwnerItem
, PropertyNames.Font))
1244
ToolStripItem? itemOnPreviousMenuToSelect =
OwnerItem
;
1320
bool isOnOverflow = (
OwnerItem
is not null &&
OwnerItem
.IsOnOverflow);
1353
if (
OwnerItem
is not null &&
OwnerItem
.IsInDesignMode)
1388
((
OwnerItem
is null ||
OwnerItem
.Pressed) && charCode != ' ' && ProcessMnemonic(charCode))
1669
ToolStrip? parentToolStrip =
OwnerItem
?.ParentInternal;
1754
if (!DesignMode && IsFirstDropDown &&
OwnerItem
is not null && TopLevel)
1821
if (
OwnerItem
is null && control.RightToLeft == RightToLeft.Yes)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.ToolStripDropDownAccessibleObject.cs (3)
32
&& owner.AccessibleName is { } name ? name : owner?.
OwnerItem
?.AccessibilityObject.Name;
50
&& (owner?.
OwnerItem
?.AccessibilityObject.CanGetNameInternal ?? true);
56
return owner?.
OwnerItem
?.AccessibilityObject.GetNameInternal() ?? default;
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownItem.cs (4)
277
return DropDown.
OwnerItem
== this && DropDown.Visible;
491
if (DropDown.
OwnerItem
!= this)
520
if (DropDown.
OwnerItem
!= this)
548
if (DropDown.
OwnerItem
== this)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownMenu.ToolStripDropDownMenuAccessibleObject.cs (1)
20
=> owner.
OwnerItem
?.AccessibilityObject,
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (3)
1442
return currentParent.
OwnerItem
;
3579
if (_parent is ToolStripDropDown dropDown && dropDown.
OwnerItem
is not null)
3581
neighbors.Add(((IKeyboardToolTip)dropDown.
OwnerItem
).GetNativeScreenRectangle());
System\Windows\Forms\Controls\ToolStrips\ToolStripItemCollection.cs (1)
231
if (dropDown.
OwnerItem
== value)
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.ModalMenuFilter.cs (1)
301
activeToolStripDropDown.
OwnerItem
?.Unselect();
System\Windows\Forms\Controls\ToolStrips\ToolStripOverflow.ToolStripOverflowAccessibleObject.cs (1)
32
=> owner.
OwnerItem
?.AccessibilityObject,
System\Windows\Forms\Controls\ToolStrips\ToolStripRenderEventArgs.cs (1)
98
ToolStripDropDownItem? ownerItem = dropDown.
OwnerItem
as ToolStripDropDownItem;
System\Windows\Forms\Internal\WinFormsUtils.cs (2)
177
if (c is ToolStripDropDown dd && dd.
OwnerItem
is not null)
179
nameOfControl += $"{Environment.NewLine}\tOwnerItem: {dd.
OwnerItem
}";
System.Windows.Forms.Design (72)
System\Windows\Forms\Design\TemplateNodeCustomMenuItemCollection.cs (1)
138
if (parentDropDown.
OwnerItem
is ToolStripDropDownItem ownerItem)
System\Windows\Forms\Design\ToolStripDesigner.cs (6)
784
ToolStripItem ownerItem = dropDown.
OwnerItem
;
786
ToolStripItem topMostItem = (topmost is null) ? ownerItem : topmost.
OwnerItem
;
797
ToolStripItem parentItem = ((ToolStripDropDown)(item.Owner)).
OwnerItem
;
801
ToolStripItem topMostItem = (topmost is null) ? parentItem : topmost.
OwnerItem
;
842
if (parent.
OwnerItem
is ToolStripDropDownItem ownerItem)
1619
topmost = topmost?.
OwnerItem
.GetCurrentParent() as ToolStripDropDown;
System\Windows\Forms\Design\ToolStripDropDownDesigner.cs (2)
462
ToolStripItem ownerItem = parent.
OwnerItem
;
480
ToolStripItem topMostItem = topmost.
OwnerItem
;
System\Windows\Forms\Design\ToolStripInSituService.cs (1)
99
if (dropDown.
OwnerItem
is ToolStripDropDownItem parentItem)
System\Windows\Forms\Design\ToolStripItemBehavior.cs (8)
563
ToolStripItem ownerItem = parentDropDown.
OwnerItem
;
615
ToolStripDropDownItem ownerItem = dropDown.
OwnerItem
as ToolStripDropDownItem;
683
ToolStripItem ownerItem = dropDown.
OwnerItem
;
733
parentToolStrip = overflow.
OwnerItem
.Owner;
765
ToolStripItem ownerItem = dropDown.
OwnerItem
;
778
ToolStripItem ownerItem = dropDown.
OwnerItem
;
803
if (dropDown.
OwnerItem
is ToolStripDropDownItem ownerItem)
1005
ToolStripItem ownerItem = parentDropDown.
OwnerItem
;
System\Windows\Forms\Design\ToolStripItemCustomMenuItemCollection.cs (4)
377
if (parent.
OwnerItem
is ToolStripDropDownItem ownerItem)
407
if ((parent is not null) && (parent.
OwnerItem
is not null) && (parent.
OwnerItem
.Owner is not null))
409
if (designerHost.GetDesigner(parent.
OwnerItem
.Owner) is ToolStripDesigner toolStripDesigner)
System\Windows\Forms\Design\ToolStripItemDesigner.cs (7)
210
return parentDropDown.IsAutoGenerated ? parentDropDown.
OwnerItem
: parentDropDown;
275
ToolStripItem ownerItem = parentDropDown.
OwnerItem
;
614
while (topmost.
OwnerItem
is not null && (topmost.
OwnerItem
.Owner is ToolStripDropDown))
616
topmost = topmost.
OwnerItem
.Owner as ToolStripDropDown;
742
ownerItem = parentDropDown.
OwnerItem
;
991
if (parentDropDown.
OwnerItem
is ToolStripDropDownItem parentItem)
System\Windows\Forms\Design\ToolStripKeyboardHandlingService.cs (18)
642
if (parentDropDown.
OwnerItem
is ToolStripDropDownItem ownerItem)
850
ToolStripDropDownItem ownerItem = (ToolStripDropDownItem)((ToolStripDropDown)(typeHereNode.Owner)).
OwnerItem
;
945
ToolStripDropDownItem ownerItem = (ToolStripDropDownItem)((ToolStripDropDown)(typeHereNode.Owner)).
OwnerItem
;
1225
: (object)parent.
OwnerItem
;
1272
ToolStripItem owner = ((ToolStripDropDown)item.Owner).
OwnerItem
;
1400
if (parentToMoveOn.
OwnerItem
is not null
1401
&& !parentToMoveOn.
OwnerItem
.IsOnDropDown
1402
&& parentToMoveOn.
OwnerItem
.Owner?.Site is not null
1409
targetSelection = parentToMoveOn.
OwnerItem
;
1428
targetSelection = GetNextItem(owner, parentToMoveOn.
OwnerItem
, ArrowDirection.Left);
1442
if (parentToMoveOn.
OwnerItem
is not null
1443
&& !parentToMoveOn.
OwnerItem
.IsOnDropDown
1444
&& parentToMoveOn.
OwnerItem
.Owner?.Site is not null
1452
targetSelection = parentToMoveOn.
OwnerItem
;
1724
next = ((ToolStripDropDown)toolStripItem.Owner).
OwnerItem
;
1850
ToolStripItem parentItem = ((ToolStripDropDown)designerItem.Owner).
OwnerItem
;
1852
item = dropDown is not null ? dropDown.
OwnerItem
: parentItem;
1871
targetSelection = GetNextItem(owner, ((ToolStripDropDown)parent).
OwnerItem
, ArrowDirection.Left);
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (25)
294
ToolStripDropDownItem parentItem = dropDown.
OwnerItem
as ToolStripDropDownItem;
304
&& menuStrip.
OwnerItem
== Component
337
return dropDown.
OwnerItem
;
934
ToolStripItem ownerLastSelected = lastDropDown.
OwnerItem
;
935
ToolStripItem ownerCurrentSelected = currentDropDown.
OwnerItem
;
968
currentItem = (ToolStripDropDownItem)dropDown.
OwnerItem
;
1258
selectedItem = ((ToolStripDropDown)item.Owner).
OwnerItem
as ToolStripDropDownItem;
1323
ToolStripItem ownerItem = dropDown.
OwnerItem
;
1412
ToolStripItem topMostItem = topmost?.
OwnerItem
;
1430
ToolStripItem ownerItem = dropDown.
OwnerItem
;
1440
item = (ToolStripDropDownItem)itemDropDown.
OwnerItem
;
1467
item = (ToolStripDropDownItem)dropDown.
OwnerItem
;
1563
ToolStripItem topMostItem = firstDropDown.
OwnerItem
;
1576
if (MenuItem.DropDown.
OwnerItem
is ToolStripDropDownItem currentOwner && currentOwner != MenuItem)
1625
if (startDropDown.
OwnerItem
is ToolStripDropDownItem ownerItem)
1882
ToolStripDropDownItem ownerItem = (ToolStripDropDownItem)owner.
OwnerItem
;
1965
ToolStripDropDownItem ownerItem = (ToolStripDropDownItem)owner.
OwnerItem
;
2213
if (parent.
OwnerItem
== MenuItem || parent.
OwnerItem
is null)
2219
parent = parent.
OwnerItem
.Owner as ToolStripDropDown;
2247
parent = parent.
OwnerItem
.Owner as ToolStripDropDown;
2254
if (MenuItem.DropDown.
OwnerItem
== MenuItem)
2499
_parentItem = dropDown.
OwnerItem
;
2561
currentSelection = (ToolStripDropDownItem)currentDropDown.
OwnerItem
;
2687
ownerItem = parentToolStrip.
OwnerItem
as ToolStripDropDownItem;
System.Windows.Forms.Tests (7)
System\Windows\Forms\ToolStripDropDownItemTests.cs (5)
339
Assert.Same(item, item.DropDown.
OwnerItem
);
398
Assert.Same(item, item.DropDown.
OwnerItem
);
418
Assert.Same(item, item.DropDown.
OwnerItem
);
438
Assert.Same(item, item.DropDown.
OwnerItem
);
455
Assert.Null(item.DropDown.
OwnerItem
);
System\Windows\Forms\ToolStripDropDownTests.cs (1)
123
Assert.Null(control.
OwnerItem
);
ToolStripDropDownMenuTests.cs (1)
25
Assert.Equal(owner, menu.
OwnerItem
);