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 14315OwnerItem = ownerItem 14337OwnerItem = ownerItem
124 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)
2103if (dropDown?.OwnerItem is not null && dropDown.OwnerItem.IsInDesignMode) 2135if (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; 1060return (topmost.OwnerItem is null) ? null : topmost.OwnerToolStrip; 1066return topmost.OwnerItem; 1213if (OwnerToolStrip is not null && OwnerItem is not null) 1215if (OwnerItem.Bounds.Contains(WindowsFormsUtils.TranslatePoint(mea.Location, this, OwnerToolStrip))) 1231if (IsAutoGenerated && OwnerItem is not null) 1233using (new LayoutTransaction(this, OwnerItem, PropertyNames.Font)) 1244ToolStripItem? itemOnPreviousMenuToSelect = OwnerItem; 1320bool isOnOverflow = (OwnerItem is not null && OwnerItem.IsOnOverflow); 1353if (OwnerItem is not null && OwnerItem.IsInDesignMode) 1388((OwnerItem is null || OwnerItem.Pressed) && charCode != ' ' && ProcessMnemonic(charCode)) 1669ToolStrip? parentToolStrip = OwnerItem?.ParentInternal; 1754if (!DesignMode && IsFirstDropDown && OwnerItem is not null && TopLevel) 1821if (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; 3579if (_parent is ToolStripDropDown dropDown && dropDown.OwnerItem is not null) 3581neighbors.Add(((IKeyboardToolTip)dropDown.OwnerItem).GetNativeScreenRectangle());
System\Windows\Forms\Controls\ToolStrips\ToolStripItemCollection.cs (1)
231if (dropDown.OwnerItem == value)
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.ModalMenuFilter.cs (1)
301activeToolStripDropDown.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 (72)
System\Windows\Forms\Design\TemplateNodeCustomMenuItemCollection.cs (1)
138if (parentDropDown.OwnerItem is ToolStripDropDownItem ownerItem)
System\Windows\Forms\Design\ToolStripDesigner.cs (6)
784ToolStripItem ownerItem = dropDown.OwnerItem; 786ToolStripItem topMostItem = (topmost is null) ? ownerItem : topmost.OwnerItem; 797ToolStripItem parentItem = ((ToolStripDropDown)(item.Owner)).OwnerItem; 801ToolStripItem topMostItem = (topmost is null) ? parentItem : topmost.OwnerItem; 842if (parent.OwnerItem is ToolStripDropDownItem ownerItem) 1619topmost = 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 (18)
642if (parentDropDown.OwnerItem is ToolStripDropDownItem ownerItem) 850ToolStripDropDownItem ownerItem = (ToolStripDropDownItem)((ToolStripDropDown)(typeHereNode.Owner)).OwnerItem; 945ToolStripDropDownItem ownerItem = (ToolStripDropDownItem)((ToolStripDropDown)(typeHereNode.Owner)).OwnerItem; 1225: (object)parent.OwnerItem; 1272ToolStripItem owner = ((ToolStripDropDown)item.Owner).OwnerItem; 1400if (parentToMoveOn.OwnerItem is not null 1401&& !parentToMoveOn.OwnerItem.IsOnDropDown 1402&& parentToMoveOn.OwnerItem.Owner?.Site is not null 1409targetSelection = parentToMoveOn.OwnerItem; 1428targetSelection = GetNextItem(owner, parentToMoveOn.OwnerItem, ArrowDirection.Left); 1442if (parentToMoveOn.OwnerItem is not null 1443&& !parentToMoveOn.OwnerItem.IsOnDropDown 1444&& parentToMoveOn.OwnerItem.Owner?.Site is not null 1452targetSelection = parentToMoveOn.OwnerItem; 1724next = ((ToolStripDropDown)toolStripItem.Owner).OwnerItem; 1850ToolStripItem parentItem = ((ToolStripDropDown)designerItem.Owner).OwnerItem; 1852item = dropDown is not null ? dropDown.OwnerItem : parentItem; 1871targetSelection = 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; 934ToolStripItem ownerLastSelected = lastDropDown.OwnerItem; 935ToolStripItem ownerCurrentSelected = currentDropDown.OwnerItem; 968currentItem = (ToolStripDropDownItem)dropDown.OwnerItem; 1258selectedItem = ((ToolStripDropDown)item.Owner).OwnerItem as ToolStripDropDownItem; 1323ToolStripItem ownerItem = dropDown.OwnerItem; 1412ToolStripItem topMostItem = topmost?.OwnerItem; 1430ToolStripItem ownerItem = dropDown.OwnerItem; 1440item = (ToolStripDropDownItem)itemDropDown.OwnerItem; 1467item = (ToolStripDropDownItem)dropDown.OwnerItem; 1563ToolStripItem topMostItem = firstDropDown.OwnerItem; 1576if (MenuItem.DropDown.OwnerItem is ToolStripDropDownItem currentOwner && currentOwner != MenuItem) 1625if (startDropDown.OwnerItem is ToolStripDropDownItem ownerItem) 1882ToolStripDropDownItem ownerItem = (ToolStripDropDownItem)owner.OwnerItem; 1965ToolStripDropDownItem ownerItem = (ToolStripDropDownItem)owner.OwnerItem; 2213if (parent.OwnerItem == MenuItem || parent.OwnerItem is null) 2219parent = parent.OwnerItem.Owner as ToolStripDropDown; 2247parent = parent.OwnerItem.Owner as ToolStripDropDown; 2254if (MenuItem.DropDown.OwnerItem == MenuItem) 2499_parentItem = dropDown.OwnerItem; 2561currentSelection = (ToolStripDropDownItem)currentDropDown.OwnerItem; 2687ownerItem = 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);