16 writes to OwnerItem
System.Windows.Forms (2)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownItem.cs (2)
529DropDown.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)
191MenuItem.DropDown.OwnerItem = MenuItem;
System.Windows.Forms.Tests (12)
System\Windows\Forms\ToolStripDropDownTests.cs (6)
2348OwnerItem = ownerItem 2369OwnerItem = ownerItem 3738OwnerItem = ownerItem 3767OwnerItem = ownerItem 4623OwnerItem = ownerItem 4652OwnerItem = ownerItem
System\Windows\Forms\ToolStripItemTests.cs (6)
6650OwnerItem = result 6676OwnerItem = result 6691OwnerItem = ownerItem 6696OwnerItem = parentItem 14334OwnerItem = ownerItem 14356OwnerItem = ownerItem
126 references to OwnerItem
System.Windows.Forms (45)
System\Windows\Forms\Controls\Menus\MenuTimer.cs (1)
149ToolStripMenuItem? menuItem = toolStrip.ActiveDropDowns[0].OwnerItem as ToolStripMenuItem;
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (6)
2105if (dropDown?.OwnerItem is not null && dropDown.OwnerItem.IsInDesignMode) 2137if (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)
365return IsAutoGenerated && OwnerItem is not null ? OwnerItem.Font : base.Font; 632get { return OwnerItem as ToolStripDropDownItem; } 707if (OwnerItem is not null) 709return OwnerItem.RightToLeft; 1063return (topmost.OwnerItem is null) ? null : topmost.OwnerToolStrip; 1069return topmost.OwnerItem; 1216if (OwnerToolStrip is not null && OwnerItem is not null) 1218if (OwnerItem.Bounds.Contains(WindowsFormsUtils.TranslatePoint(mea.Location, this, OwnerToolStrip))) 1234if (IsAutoGenerated && OwnerItem is not null) 1236using (new LayoutTransaction(this, OwnerItem, PropertyNames.Font)) 1247ToolStripItem? itemOnPreviousMenuToSelect = OwnerItem; 1323bool isOnOverflow = (OwnerItem is not null && OwnerItem.IsOnOverflow); 1356if (OwnerItem is not null && OwnerItem.IsInDesignMode) 1391((OwnerItem is null || OwnerItem.Pressed) && charCode != ' ' && ProcessMnemonic(charCode)) 1672ToolStrip? parentToolStrip = OwnerItem?.ParentInternal; 1757if (!DesignMode && IsFirstDropDown && OwnerItem is not null && TopLevel) 1824if (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); 56return owner?.OwnerItem?.AccessibilityObject.GetNameInternal() ?? default;
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownItem.cs (4)
277return DropDown.OwnerItem == this && DropDown.Visible; 491if (DropDown.OwnerItem != this) 520if (DropDown.OwnerItem != this) 548if (DropDown.OwnerItem == this)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownMenu.ToolStripDropDownMenuAccessibleObject.cs (1)
20=> owner.OwnerItem?.AccessibilityObject,
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (3)
1442return currentParent.OwnerItem; 3587if (_parent is ToolStripDropDown dropDown && dropDown.OwnerItem is not null) 3589neighbors.Add(((IKeyboardToolTip)dropDown.OwnerItem).GetNativeScreenRectangle());
System\Windows\Forms\Controls\ToolStrips\ToolStripItemCollection.cs (1)
224if (dropDown.OwnerItem == value)
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.ModalMenuFilter.cs (1)
303activeToolStripDropDown.OwnerItem?.Unselect();
System\Windows\Forms\Controls\ToolStrips\ToolStripOverflow.ToolStripOverflowAccessibleObject.cs (1)
32=> owner.OwnerItem?.AccessibilityObject,
System\Windows\Forms\Controls\ToolStrips\ToolStripRenderEventArgs.cs (1)
98ToolStripDropDownItem? ownerItem = dropDown.OwnerItem as ToolStripDropDownItem;
System\Windows\Forms\Internal\WinFormsUtils.cs (2)
177if (c is ToolStripDropDown dd && dd.OwnerItem is not null) 179nameOfControl += $"{Environment.NewLine}\tOwnerItem: {dd.OwnerItem}";
System.Windows.Forms.Design (74)
System\Windows\Forms\Design\TemplateNodeCustomMenuItemCollection.cs (1)
138if (parentDropDown.OwnerItem is ToolStripDropDownItem ownerItem)
System\Windows\Forms\Design\ToolStripDesigner.cs (6)
784ToolStripItem ownerItem = dropDown.OwnerItem; 787ToolStripItem topMostItem = (topmost is null) ? ownerItem : topmost.OwnerItem; 798ToolStripItem parentItem = ((ToolStripDropDown)(item.Owner)).OwnerItem; 802ToolStripItem topMostItem = (topmost is null) ? parentItem : topmost.OwnerItem; 843if (parent.OwnerItem is ToolStripDropDownItem ownerItem) 1620topmost = topmost?.OwnerItem.GetCurrentParent() as ToolStripDropDown;
System\Windows\Forms\Design\ToolStripDropDownDesigner.cs (2)
462ToolStripItem ownerItem = parent.OwnerItem; 480ToolStripItem topMostItem = topmost.OwnerItem;
System\Windows\Forms\Design\ToolStripInSituService.cs (1)
99if (dropDown.OwnerItem is ToolStripDropDownItem parentItem)
System\Windows\Forms\Design\ToolStripItemBehavior.cs (8)
563ToolStripItem ownerItem = parentDropDown.OwnerItem; 615ToolStripDropDownItem ownerItem = dropDown.OwnerItem as ToolStripDropDownItem; 683ToolStripItem ownerItem = dropDown.OwnerItem; 733parentToolStrip = overflow.OwnerItem.Owner; 765ToolStripItem ownerItem = dropDown.OwnerItem; 778ToolStripItem ownerItem = dropDown.OwnerItem; 803if (dropDown.OwnerItem is ToolStripDropDownItem ownerItem) 1005ToolStripItem ownerItem = parentDropDown.OwnerItem;
System\Windows\Forms\Design\ToolStripItemCustomMenuItemCollection.cs (4)
377if (parent.OwnerItem is ToolStripDropDownItem ownerItem) 407if ((parent is not null) && (parent.OwnerItem is not null) && (parent.OwnerItem.Owner is not null)) 409if (designerHost.GetDesigner(parent.OwnerItem.Owner) is ToolStripDesigner toolStripDesigner)
System\Windows\Forms\Design\ToolStripItemDesigner.cs (7)
210return parentDropDown.IsAutoGenerated ? parentDropDown.OwnerItem : parentDropDown; 275ToolStripItem ownerItem = parentDropDown.OwnerItem; 614while (topmost.OwnerItem is not null && (topmost.OwnerItem.Owner is ToolStripDropDown)) 616topmost = topmost.OwnerItem.Owner as ToolStripDropDown; 742ownerItem = parentDropDown.OwnerItem; 991if (parentDropDown.OwnerItem is ToolStripDropDownItem parentItem)
System\Windows\Forms\Design\ToolStripKeyboardHandlingService.cs (20)
658if (parentDropDown.OwnerItem is ToolStripDropDownItem ownerItem) 866ToolStripDropDownItem ownerItem = (ToolStripDropDownItem)((ToolStripDropDown)(typeHereNode.Owner)).OwnerItem; 961ToolStripDropDownItem ownerItem = (ToolStripDropDownItem)((ToolStripDropDown)(typeHereNode.Owner)).OwnerItem; 1240: (object)parent.OwnerItem; 1287ToolStripItem owner = ((ToolStripDropDown)item.Owner).OwnerItem; 1410if (parentToMoveOn.OwnerItem is not null) // this can be null for overflow.... 1412if (!(parentToMoveOn.OwnerItem.IsOnDropDown) && (parentToMoveOn.OwnerItem.Owner is not null && parentToMoveOn.OwnerItem.Owner.Site is not null)) 1419targetSelection = parentToMoveOn.OwnerItem; 1441targetSelection = GetNextItem(owner, parentToMoveOn.OwnerItem, ArrowDirection.Left); 1455if (parentToMoveOn.OwnerItem is not null) // this can be null for overflow.... 1457if (!(parentToMoveOn.OwnerItem.IsOnDropDown) && (parentToMoveOn.OwnerItem.Owner is not null && parentToMoveOn.OwnerItem.Owner.Site is not null)) 1464targetSelection = parentToMoveOn.OwnerItem; 1741next = ((ToolStripDropDown)toolStripItem.Owner).OwnerItem; 1867ToolStripItem parentItem = ((ToolStripDropDown)designerItem.Owner).OwnerItem; 1869item = dropDown is not null ? dropDown.OwnerItem : parentItem; 1888targetSelection = GetNextItem(owner, ((ToolStripDropDown)parent).OwnerItem, ArrowDirection.Left);
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (25)
294ToolStripDropDownItem parentItem = dropDown.OwnerItem as ToolStripDropDownItem; 304&& menuStrip.OwnerItem == Component 337return dropDown.OwnerItem; 944ToolStripItem ownerLastSelected = lastDropDown.OwnerItem; 945ToolStripItem ownerCurrentSelected = currentDropDown.OwnerItem; 978currentItem = (ToolStripDropDownItem)dropDown.OwnerItem; 1268selectedItem = ((ToolStripDropDown)item.Owner).OwnerItem as ToolStripDropDownItem; 1333ToolStripItem ownerItem = dropDown.OwnerItem; 1422ToolStripItem topMostItem = topmost?.OwnerItem; 1440ToolStripItem ownerItem = dropDown.OwnerItem; 1450item = (ToolStripDropDownItem)itemDropDown.OwnerItem; 1477item = (ToolStripDropDownItem)dropDown.OwnerItem; 1573ToolStripItem topMostItem = firstDropDown.OwnerItem; 1586if (MenuItem.DropDown.OwnerItem is ToolStripDropDownItem currentOwner && currentOwner != MenuItem) 1635if (startDropDown.OwnerItem is ToolStripDropDownItem ownerItem) 1892ToolStripDropDownItem ownerItem = (ToolStripDropDownItem)owner.OwnerItem; 1975ToolStripDropDownItem ownerItem = (ToolStripDropDownItem)owner.OwnerItem; 2223if (parent.OwnerItem == MenuItem || parent.OwnerItem is null) 2229parent = parent.OwnerItem.Owner as ToolStripDropDown; 2257parent = parent.OwnerItem.Owner as ToolStripDropDown; 2264if (MenuItem.DropDown.OwnerItem == MenuItem) 2509_parentItem = dropDown.OwnerItem; 2571currentSelection = (ToolStripDropDownItem)currentDropDown.OwnerItem; 2697ownerItem = parentToolStrip.OwnerItem as ToolStripDropDownItem;
System.Windows.Forms.Tests (7)
System\Windows\Forms\ToolStripDropDownItemTests.cs (5)
339Assert.Same(item, item.DropDown.OwnerItem); 398Assert.Same(item, item.DropDown.OwnerItem); 418Assert.Same(item, item.DropDown.OwnerItem); 438Assert.Same(item, item.DropDown.OwnerItem); 455Assert.Null(item.DropDown.OwnerItem);
System\Windows\Forms\ToolStripDropDownTests.cs (1)
123Assert.Null(control.OwnerItem);
ToolStripDropDownMenuTests.cs (1)
25Assert.Equal(owner, menu.OwnerItem);