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)
2350
OwnerItem
= ownerItem
2371
OwnerItem
= ownerItem
3740
OwnerItem
= ownerItem
3769
OwnerItem
= ownerItem
4625
OwnerItem
= ownerItem
4654
OwnerItem
= ownerItem
System\Windows\Forms\ToolStripItemTests.cs (6)
6652
OwnerItem
= result
6678
OwnerItem
= result
6693
OwnerItem
= ownerItem
6698
OwnerItem
= parentItem
14317
OwnerItem
= ownerItem
14339
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)
2102
if (dropDown?.
OwnerItem
is not null && dropDown.
OwnerItem
.IsInDesignMode)
2134
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;
1057
return (topmost.
OwnerItem
is null) ? null : topmost.OwnerToolStrip;
1063
return topmost.
OwnerItem
;
1210
if (OwnerToolStrip is not null &&
OwnerItem
is not null)
1212
if (
OwnerItem
.Bounds.Contains(WindowsFormsUtils.TranslatePoint(mea.Location, this, OwnerToolStrip)))
1228
if (IsAutoGenerated &&
OwnerItem
is not null)
1230
using (new LayoutTransaction(this,
OwnerItem
, PropertyNames.Font))
1241
ToolStripItem? itemOnPreviousMenuToSelect =
OwnerItem
;
1317
bool isOnOverflow = (
OwnerItem
is not null &&
OwnerItem
.IsOnOverflow);
1350
if (
OwnerItem
is not null &&
OwnerItem
.IsInDesignMode)
1385
((
OwnerItem
is null ||
OwnerItem
.Pressed) && charCode != ' ' && ProcessMnemonic(charCode))
1666
ToolStrip? parentToolStrip =
OwnerItem
?.ParentInternal;
1751
if (!DesignMode && IsFirstDropDown &&
OwnerItem
is not null && TopLevel)
1818
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
;
3583
if (_parent is ToolStripDropDown dropDown && dropDown.
OwnerItem
is not null)
3585
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)
298
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)
748
ToolStripItem ownerItem = dropDown.
OwnerItem
;
750
ToolStripItem topMostItem = (topmost is null) ? ownerItem : topmost.
OwnerItem
;
761
ToolStripItem parentItem = ((ToolStripDropDown)(item.Owner)).
OwnerItem
;
765
ToolStripItem topMostItem = (topmost is null) ? parentItem : topmost.
OwnerItem
;
806
if (parent.
OwnerItem
is ToolStripDropDownItem ownerItem)
1665
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)
560
ToolStripItem ownerItem = parentDropDown.
OwnerItem
;
612
ToolStripDropDownItem ownerItem = dropDown.
OwnerItem
as ToolStripDropDownItem;
680
ToolStripItem ownerItem = dropDown.
OwnerItem
;
724
parentToolStrip = overflow.
OwnerItem
.Owner;
756
ToolStripItem ownerItem = dropDown.
OwnerItem
;
769
ToolStripItem ownerItem = dropDown.
OwnerItem
;
794
if (dropDown.
OwnerItem
is ToolStripDropDownItem ownerItem)
996
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
;
936
ToolStripDropDownItem ownerItem = (ToolStripDropDownItem)((ToolStripDropDown)(typeHereNode.Owner)).
OwnerItem
;
1216
: (object)parent.
OwnerItem
;
1263
ToolStripItem owner = ((ToolStripDropDown)item.Owner).
OwnerItem
;
1391
if (parentToMoveOn.
OwnerItem
is not null
1392
&& !parentToMoveOn.
OwnerItem
.IsOnDropDown
1393
&& parentToMoveOn.
OwnerItem
.Owner?.Site is not null
1400
targetSelection = parentToMoveOn.
OwnerItem
;
1419
targetSelection = GetNextItem(owner, parentToMoveOn.
OwnerItem
, ArrowDirection.Left);
1433
if (parentToMoveOn.
OwnerItem
is not null
1434
&& !parentToMoveOn.
OwnerItem
.IsOnDropDown
1435
&& parentToMoveOn.
OwnerItem
.Owner?.Site is not null
1443
targetSelection = parentToMoveOn.
OwnerItem
;
1715
next = ((ToolStripDropDown)toolStripItem.Owner).
OwnerItem
;
1841
ToolStripItem parentItem = ((ToolStripDropDown)designerItem.Owner).
OwnerItem
;
1843
item = dropDown is not null ? dropDown.
OwnerItem
: parentItem;
1862
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)
2496
_parentItem = dropDown.
OwnerItem
;
2558
currentSelection = (ToolStripDropDownItem)currentDropDown.
OwnerItem
;
2684
ownerItem = parentToolStrip.
OwnerItem
as ToolStripDropDownItem;
System.Windows.Forms.Tests (7)
System\Windows\Forms\ToolStripDropDownItemTests.cs (5)
341
Assert.Same(item, item.DropDown.
OwnerItem
);
400
Assert.Same(item, item.DropDown.
OwnerItem
);
420
Assert.Same(item, item.DropDown.
OwnerItem
);
440
Assert.Same(item, item.DropDown.
OwnerItem
);
457
Assert.Null(item.DropDown.
OwnerItem
);
System\Windows\Forms\ToolStripDropDownTests.cs (1)
125
Assert.Null(control.
OwnerItem
);
ToolStripDropDownMenuTests.cs (1)
27
Assert.Equal(owner, menu.
OwnerItem
);