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
14334
OwnerItem
= ownerItem
14356
OwnerItem
= ownerItem
126 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)
2105
if (dropDown?.
OwnerItem
is not null && dropDown.
OwnerItem
.IsInDesignMode)
2137
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;
1063
return (topmost.
OwnerItem
is null) ? null : topmost.OwnerToolStrip;
1069
return topmost.
OwnerItem
;
1216
if (OwnerToolStrip is not null &&
OwnerItem
is not null)
1218
if (
OwnerItem
.Bounds.Contains(WindowsFormsUtils.TranslatePoint(mea.Location, this, OwnerToolStrip)))
1234
if (IsAutoGenerated &&
OwnerItem
is not null)
1236
using (new LayoutTransaction(this,
OwnerItem
, PropertyNames.Font))
1247
ToolStripItem? itemOnPreviousMenuToSelect =
OwnerItem
;
1323
bool isOnOverflow = (
OwnerItem
is not null &&
OwnerItem
.IsOnOverflow);
1356
if (
OwnerItem
is not null &&
OwnerItem
.IsInDesignMode)
1391
((
OwnerItem
is null ||
OwnerItem
.Pressed) && charCode != ' ' && ProcessMnemonic(charCode))
1672
ToolStrip? parentToolStrip =
OwnerItem
?.ParentInternal;
1757
if (!DesignMode && IsFirstDropDown &&
OwnerItem
is not null && TopLevel)
1824
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
;
3587
if (_parent is ToolStripDropDown dropDown && dropDown.
OwnerItem
is not null)
3589
neighbors.Add(((IKeyboardToolTip)dropDown.
OwnerItem
).GetNativeScreenRectangle());
System\Windows\Forms\Controls\ToolStrips\ToolStripItemCollection.cs (1)
224
if (dropDown.
OwnerItem
== value)
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.ModalMenuFilter.cs (1)
303
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 (74)
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
;
787
ToolStripItem topMostItem = (topmost is null) ? ownerItem : topmost.
OwnerItem
;
798
ToolStripItem parentItem = ((ToolStripDropDown)(item.Owner)).
OwnerItem
;
802
ToolStripItem topMostItem = (topmost is null) ? parentItem : topmost.
OwnerItem
;
843
if (parent.
OwnerItem
is ToolStripDropDownItem ownerItem)
1620
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 (20)
658
if (parentDropDown.
OwnerItem
is ToolStripDropDownItem ownerItem)
866
ToolStripDropDownItem ownerItem = (ToolStripDropDownItem)((ToolStripDropDown)(typeHereNode.Owner)).
OwnerItem
;
961
ToolStripDropDownItem ownerItem = (ToolStripDropDownItem)((ToolStripDropDown)(typeHereNode.Owner)).
OwnerItem
;
1240
: (object)parent.
OwnerItem
;
1287
ToolStripItem owner = ((ToolStripDropDown)item.Owner).
OwnerItem
;
1410
if (parentToMoveOn.
OwnerItem
is not null) // this can be null for overflow....
1412
if (!(parentToMoveOn.
OwnerItem
.IsOnDropDown) && (parentToMoveOn.
OwnerItem
.Owner is not null && parentToMoveOn.
OwnerItem
.Owner.Site is not null))
1419
targetSelection = parentToMoveOn.
OwnerItem
;
1441
targetSelection = GetNextItem(owner, parentToMoveOn.
OwnerItem
, ArrowDirection.Left);
1455
if (parentToMoveOn.
OwnerItem
is not null) // this can be null for overflow....
1457
if (!(parentToMoveOn.
OwnerItem
.IsOnDropDown) && (parentToMoveOn.
OwnerItem
.Owner is not null && parentToMoveOn.
OwnerItem
.Owner.Site is not null))
1464
targetSelection = parentToMoveOn.
OwnerItem
;
1741
next = ((ToolStripDropDown)toolStripItem.Owner).
OwnerItem
;
1867
ToolStripItem parentItem = ((ToolStripDropDown)designerItem.Owner).
OwnerItem
;
1869
item = dropDown is not null ? dropDown.
OwnerItem
: parentItem;
1888
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
;
944
ToolStripItem ownerLastSelected = lastDropDown.
OwnerItem
;
945
ToolStripItem ownerCurrentSelected = currentDropDown.
OwnerItem
;
978
currentItem = (ToolStripDropDownItem)dropDown.
OwnerItem
;
1268
selectedItem = ((ToolStripDropDown)item.Owner).
OwnerItem
as ToolStripDropDownItem;
1333
ToolStripItem ownerItem = dropDown.
OwnerItem
;
1422
ToolStripItem topMostItem = topmost?.
OwnerItem
;
1440
ToolStripItem ownerItem = dropDown.
OwnerItem
;
1450
item = (ToolStripDropDownItem)itemDropDown.
OwnerItem
;
1477
item = (ToolStripDropDownItem)dropDown.
OwnerItem
;
1573
ToolStripItem topMostItem = firstDropDown.
OwnerItem
;
1586
if (MenuItem.DropDown.
OwnerItem
is ToolStripDropDownItem currentOwner && currentOwner != MenuItem)
1635
if (startDropDown.
OwnerItem
is ToolStripDropDownItem ownerItem)
1892
ToolStripDropDownItem ownerItem = (ToolStripDropDownItem)owner.
OwnerItem
;
1975
ToolStripDropDownItem ownerItem = (ToolStripDropDownItem)owner.
OwnerItem
;
2223
if (parent.
OwnerItem
== MenuItem || parent.
OwnerItem
is null)
2229
parent = parent.
OwnerItem
.Owner as ToolStripDropDown;
2257
parent = parent.
OwnerItem
.Owner as ToolStripDropDown;
2264
if (MenuItem.DropDown.
OwnerItem
== MenuItem)
2509
_parentItem = dropDown.
OwnerItem
;
2571
currentSelection = (ToolStripDropDownItem)currentDropDown.
OwnerItem
;
2697
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
);