187 writes to Owner
System.Windows.Forms.Tests (187)
System\Windows\Forms\ToolStripButtonTests.cs (7)
666Owner = owner, 694Owner = owner 885Owner = owner, 906Owner = owner 1283Owner = owner 1374Owner = owner 1506Owner = owner
System\Windows\Forms\ToolStripControlHostTests.cs (3)
1462Owner = owner, 3083Owner = owner 3272Owner = owner
System\Windows\Forms\ToolStripDropDownItemTests.cs (1)
412Owner = owner
System\Windows\Forms\ToolStripItemTests.cs (163)
484Owner = owner 516Owner = owner 588Owner = owner, 615Owner = owner 811Owner = owner 895Owner = owner 941Owner = owner 1218Owner = owner 1262Owner = owner, 1307Owner = owner 1552Owner = owner 1593Owner = owner 1613Owner = owner 1795Owner = owner 1815Owner = owner 1924Owner = owner 1944Owner = owner 2061Owner = owner 2083Owner = owner 2136Owner = owner 2177Owner = owner 2380Owner = owner 2475Owner = owner 2622Owner = owner 2649Owner = owner 2687Owner = owner 2714Owner = owner 2957Owner = owner 3008Owner = owner, 3049Owner = owner, 3242Owner = owner 3283Owner = owner 3303Owner = owner 3483Owner = owner 3519Owner = owner 3682Owner = owner 3703Owner = owner 3724Owner = owner 3902Owner = owner 3947Owner = owner 4111Owner = owner 4156Owner = owner 4200Owner = owner 4247Owner = owner 4458Owner = owner 4507Owner = owner 4552Owner = owner 4792Owner = owner 4870Owner = owner 4958Owner = owner 5009Owner = owner 5052Owner = owner 5291Owner = owner 5383Owner = owner 5427Owner = owner 5467Owner = owner 5650Owner = owner, 5683Owner = owner, 5815Owner = owner 5826Owner = owner 5840Owner = owner 5919Owner = owner 5958Owner = owner 6251Owner = owner 6296Owner = owner 6446Owner = owner 6454item.Owner = owner; 6462item.Owner = otherOwner; 6470item.Owner = null; 6478item.Owner = statusOwner; 6496Owner = owner 6504item.Owner = owner; 6512item.Owner = otherOwner; 6520item.Owner = null; 6528item.Owner = statusOwner; 6565item.Owner = owner; 6571item.Owner = owner; 6592item.Owner = owner; 6598item.Owner = owner; 6605item.Owner = otherOwner; 6612item.Owner = null; 6620item.Owner = owner; 6633Owner = owner 6654Owner = owner 6700Owner = owner, 6748Owner = owner 6787Owner = owner 7106Owner = owner 7141Owner = owner, 7185Owner = owner 7227Owner = owner 7493Owner = owner 7531Owner = owner 7711Owner = owner 7723Owner = owner 7735Owner = owner 7789Owner = parent, 7860Owner = owner 7896Owner = owner 8086Owner = owner 8128Owner = owner 8316Owner = owner 8363Owner = owner 8508Owner = owner 8544Owner = owner, 8591Owner = owner 8633Owner = owner 8843Owner = owner 8886Owner = owner 9137Owner = owner 9268Owner = owner 9312Owner = owner, 9357Owner = owner 9650Owner = owner 9686Owner = owner 9915Owner = owner 10068Owner = owner 10207Owner = owner 10224Owner = owner 10310Owner = owner 10342Owner = owner 10402Owner = owner 10418Owner = owner 10512Owner = owner 10529Owner = owner 10656Owner = owner 10686Owner = owner 10810Owner = owner 10834Owner = owner 11192Owner = owner 11225Owner = owner 11383Owner = owner, 11421Owner = owner, 11571Owner = owner 11601Owner = owner 11868Owner = owner 11968Owner = owner 12000Owner = owner 12231Owner = owner, 12293Owner = owner, 12339Owner = owner, 12761Owner = owner 12811Owner = owner 12997Owner = owner 13047Owner = owner 13285Owner = owner 13329Owner = owner 13395Owner = owner 13461Owner = owner 13762Owner = owner 13814Owner = owner 14330Owner = ownerItemOwner 14338Owner = owner 14360Owner = owner 14378Owner = owner 14397Owner = owner 14430Owner = owner 14448Owner = owner 14600Owner = owner 14647Owner = owner 14949Owner = owner 14993Owner = owner, 15038Owner = owner
System\Windows\Forms\ToolStripSeparatorTests.cs (10)
806Owner = owner 836Owner = owner 944Owner = owner, 975Owner = owner, 1136Owner = owner 1229Owner = owner, 1300Owner = owner, 1345Owner = owner, 1401Owner = owner 1463Owner = owner
System\Windows\Forms\ToolStripTests.cs (3)
7003Owner = control 7045Owner = control 7115Owner = otherControl
284 references to Owner
System.Windows.Forms (107)
System\Windows\Forms\Accessibility\Control.ControlAccessibleObject.cs (1)
554Owner?.ToolStripControlHost?.Owner?.AccessibilityObject;
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (4)
2137if (this is ToolStripDropDown dropDown && dropDown.OwnerItem is not null && (dropDown.OwnerItem.IsInDesignMode || (dropDown.OwnerItem.Owner is not null && dropDown.OwnerItem.Owner.IsInDesignMode))) 3509if (!IsDropDown && item.Owner == this) 4066if (item.Owner != this)
System\Windows\Forms\Controls\ToolStrips\ToolStripButton.cs (1)
202if (Owner is null)
System\Windows\Forms\Controls\ToolStrips\ToolStripComboBox.ToolStripComboBoxControl.ToolStripComboBoxControlAccessibleObject.cs (1)
39? owner.Owner?.Owner?.AccessibilityObject
System\Windows\Forms\Controls\ToolStrips\ToolStripControlHost.cs (1)
685if (oldParent is not null && Owner is null && newParent is null && _control is not null)
System\Windows\Forms\Controls\ToolStrips\ToolStripControlHost.ToolStripHostedControlAccessibleObject.cs (2)
35&& _toolStripControlHost.Owner is not null 36? _toolStripControlHost.Owner.AccessibilityObject
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.cs (5)
305_ownerItem?.Owner is not null ? _ownerItem.Owner.DropDownOwnerWindow : base.DropDownOwnerWindow; 648if (_ownerItem.Placement == ToolStripItemPlacement.Overflow && _ownerItem.Owner is not null) 650return _ownerItem.Owner.OverflowButton.DropDown; 655return _ownerItem.Owner;
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownButton.cs (1)
179if (Owner is not null)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownItemAccessibleObject.cs (2)
66_owner.Owner is ToolStripDropDown toolStripDropDown 180if (_owner.Owner is not ToolStripDropDown dropDown)
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (50)
659if (Owner is not null and StatusStrip) 801if (Owner is not null) 803parentEnabled = Owner.Enabled; 966IArrangedElement? IArrangedElement.Container => ParentInternal ?? Owner; 1026if (image is null && Owner?.ImageList is not null && ImageIndexer.ActualIndex >= 0) 1029if (!disposing && ImageIndexer.ActualIndex < Owner.ImageList.Images.Count) 1032image = Owner.ImageList.Images[ImageIndexer.ActualIndex]; 1117if ((Owner is not null) && ImageIndexer.Index != ImageList.Indexer.DefaultIndex 1118&& Owner.ImageList is not null && ImageIndexer.Index >= Owner.ImageList.Images.Count) 1120return Owner.ImageList.Images.Count - 1; 1229else if (Owner is not null && Owner.IsDropDown) 1434else if (Owner is not null) 1437currentParent = Owner as ToolStripDropDown; 1498if (Owner is not null) 1500LayoutTransaction.DoLayout(Owner, Owner, "Overflow"); 1557bool usingImageList = ((Owner is not null) && (Owner.ImageList is not null) && (ImageIndexer.ActualIndex >= 0)); 1561ToolStrip? ownerToolStrip = Owner; 1571imageSize = Owner?.ImageList?.ImageSize ?? Size.Empty; 1626if (Owner is not null) 1628return Owner.Renderer; 1654if (Owner is not null) 1656rightToLeft = Owner.RightToLeft; 1923textDirection = (Owner is null) ? ToolStripTextDirection.Horizontal : Owner.TextDirection; 2099if (Owner is not null) 2102Debug.Assert(Owner.Items.Contains(this), "How can there be a owner and not be in the collection?"); 2103Owner.Items.Remove(this); 2326private Font? GetOwnerFont() => Owner?.Font; 2341return Owner as ToolStripDropDown; 2386if (Owner is not null) 2388LayoutTransaction.DoLayout(Owner, this, affectedProperty); 2393Owner?.Invalidate(); 2426if (SupportsItemClick && Owner is not null) 2428Owner.HandleItemClick(this); 2433if (SupportsItemClick && Owner is not null) 2435Owner.HandleItemClicked(this); 2960if (Owner is not null) 3009if (Owner is not null && !(Owner.IsDisposed || Owner.Disposing)) 3011Owner.OnItemVisibleChanged(new ToolStripItemEventArgs(this), performLayout: true); 3133if (Owner is not null && Owner.IsCurrentlyDragging) 3434parent ??= (IsOnOverflow && Owner is not null) ? Owner.OverflowButton.DropDown : Owner;
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.ToolStripItemImageIndexer.cs (1)
20get => _item.Owner?.ImageList;
System\Windows\Forms\Controls\ToolStrips\ToolStripItemCollection.cs (1)
511item.Owner?.Items.Remove(item);
System\Windows\Forms\Controls\ToolStrips\ToolStripLabel.cs (1)
334if (Owner is not null)
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.cs (3)
1206PreviousIndexCollection = source.Owner!.Items 1226PreviousIndexCollection = source.Owner!.Items 1241PreviousIndexCollection = source.Owner!.Items
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.cs (8)
375ToolStrip? owner = Owner; 925if (Owner is not null) 927if (Owner.Shortcuts.ContainsKey(shortcut)) 930Owner.Shortcuts[shortcut] = this; 934Owner.Shortcuts.Add(shortcut, this); 937_lastOwner = Owner; 946if (Owner is null) 1073if (Owner is ToolStripDropDownMenu dropDownMenu)
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.ToolStripMenuItemInternalLayout.cs (8)
25if (_ownerItem.Owner is ToolStripDropDownMenu menu) 38if (_ownerItem.Owner is ToolStripDropDownMenu menu) 69if (_ownerItem.Owner is ToolStripDropDownMenu menu) 89if (_ownerItem.Owner is ToolStripDropDownMenu menu) 113if (_ownerItem.Owner is ToolStripDropDownMenu menu) 145if (_ownerItem.Owner is ToolStripDropDownMenu menu) 159return _ownerItem.Owner is ToolStripDropDownMenu; 167if (_ownerItem.Owner is ToolStripDropDownMenu menu)
System\Windows\Forms\Controls\ToolStrips\ToolstripProfessionalRenderer.cs (6)
604else if (item.Owner is not null && item.BackColor != item.Owner.BackColor) 655else if (item.Owner is not null && item.BackColor != item.Owner.BackColor) 1587else if (item.Owner is not null && item.BackColor != item.Owner.BackColor)
System\Windows\Forms\Controls\ToolStrips\ToolStripProgressBar.cs (1)
87if (Owner is not null and StatusStrip)
System\Windows\Forms\Controls\ToolStrips\ToolStripProgressBar.ToolStripProgressBarControlAccessibleObject.cs (1)
21_ownerToolStripProgressBarControl.Owner?.Owner?.AccessibilityObject;
System\Windows\Forms\Controls\ToolStrips\ToolStripScrollButton.StickyLabelAccessibleObject.cs (1)
43_owner.OwnerScrollButton?.Owner?.AccessibilityObject;
System\Windows\Forms\Controls\ToolStrips\ToolStripSeparator.cs (4)
171ToolStrip? parent = ParentInternal ?? Owner; 259ToolStrip? parent = ParentInternal ?? Owner; 290if (Owner is not null && ParentInternal is not null) 308if (Owner is ToolStripDropDownMenu dropDownMenu)
System\Windows\Forms\Controls\ToolStrips\ToolStripStatusLabel.cs (2)
119LayoutTransaction.DoLayout(Owner, this, PropertyNames.BorderStyle); 194if (Owner is not null)
System\Windows\Forms\MDI\MdiWindowListItemConverter.cs (1)
26if (values[i] is ToolStripItem currentItem && currentItem.Owner == menu)
System\Windows\Forms\MDI\MdiWindowListStrip.cs (1)
38if (_mergeItem.Owner is null)
System.Windows.Forms.Design (97)
System\ComponentModel\Design\DesignerActionUI.cs (1)
674if (item.Owner is not null)
System\Windows\Forms\Design\TemplateNodeCustomMenuItemCollection.cs (1)
33get => _currentItem.Owner;
System\Windows\Forms\Design\ToolStripContainerDesigner.cs (1)
282parent ??= item.Owner;
System\Windows\Forms\Design\ToolStripDesigner.cs (13)
754if (item.Placement == ToolStripItemPlacement.Overflow && item.Owner == ToolStrip) 773if (item.Owner == ToolStrip) 789if (topMostItem is not null && topMostItem.Owner == ToolStrip) 798ToolStripItem parentItem = ((ToolStripDropDown)(item.Owner)).OwnerItem; 803if (topMostItem is not null && topMostItem.Owner == ToolStrip) 913if (selectedItem.Owner == ToolStrip) 976if (selectedItem is ToolStripItem currentSel && currentSel.Owner != ToolStrip) 984if (addingItem is not null && addingItem.Owner is not null) 986if (addingItem.Owner.Site is null) 1012ToolStrip parent = changingItem.Owner; 1034if (e.Component is ToolStripItem item && item.Owner == Component) 1111if (e.Component is ToolStripItem item && item.Owner == Component) 1614ToolStripDropDown topmost = item.Owner as ToolStripDropDown;
System\Windows\Forms\Design\ToolStripDesignerUtils.cs (1)
94parent = stripItem.Owner;
System\Windows\Forms\Design\ToolStripDropDownDesigner.cs (1)
457parent = item.Owner as ToolStripDropDown;
System\Windows\Forms\Design\ToolStripItemBehavior.cs (7)
398parent = glyphItem.Owner; 436bSvc?.Invalidate(glyphItem.Owner.Bounds); 561if (glyphItem.Owner is ToolStripDropDown parentDropDown) 600ToolStrip owner = selectedItem.Owner; 733parentToolStrip = overflow.OwnerItem.Owner; 849if (data.Owner == glyphItem.Owner) 1003if (glyphItem.Owner is ToolStripDropDown parentDropDown)
System\Windows\Forms\Design\ToolStripItemCustomMenuItemCollection.cs (4)
60get => _currentItem.Owner; 348InsertIntoDropDown((ToolStripDropDown)_currentItem.Owner, t); 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 (21)
160return parent ?? ToolStripItem.Owner; 175ToolStrip strip = ToolStripItem.Owner; 268parentControls.Add(item.Owner); 269startComp = item.Owner; 273if (item.Owner is ToolStripDropDown parentDropDown) 286if (item.Owner.Site is not null) 288parentControls.Add(item.Owner); 291startComp = item.Owner; 334ToolStripDesigner designer = (ToolStripDesigner)designerHost.GetDesigner(ToolStripItem.Owner); 507protected virtual Component GetOwnerForActionList() => (ToolStripItem.Placement == ToolStripItemPlacement.Main) ? ToolStripItem.GetCurrentParent() : ToolStripItem.Owner; 509internal virtual ToolStrip GetMainToolStrip() => ToolStripItem.Owner; 585parent ??= ToolStripItem.Owner; 610if (currentItem.Owner is ToolStripDropDown) 612ToolStripDropDown topmost = currentItem.Owner as ToolStripDropDown; 614while (topmost.OwnerItem is not null && (topmost.OwnerItem.Owner is ToolStripDropDown)) 616topmost = topmost.OwnerItem.Owner as ToolStripDropDown; 728parent = ToolStripItem.Owner; 988if (TryGetService(out IDesignerHost designerHost) && currentSelection.Owner is ToolStripDropDown parentDropDown) 1018else if (currentSelection.Owner is not null) 1024behaviorService.Invalidate(behaviorService.ControlRectInAdornerWindow(currentSelection.Owner)); 1123parent = ToolStripItem.Owner;
System\Windows\Forms\Design\ToolStripKeyboardHandlingService.cs (19)
771parent = selectedItem.Owner; 850ToolStripDropDownItem ownerItem = (ToolStripDropDownItem)((ToolStripDropDown)(typeHereNode.Owner)).OwnerItem; 865if (host.GetDesigner(typeHereNode.Owner) is ToolStripDesigner tooldesigner) 945ToolStripDropDownItem ownerItem = (ToolStripDropDownItem)((ToolStripDropDown)(typeHereNode.Owner)).OwnerItem; 956if (host.GetDesigner(typeHereNode.Owner) is ToolStripDesigner tooldesigner) 1272ToolStripItem owner = ((ToolStripDropDown)item.Owner).OwnerItem; 1377? dropDownItem.Owner.OverflowButton.DropDown 1378: dropDownItem.Owner) as ToolStripDropDown; 1402&& parentToMoveOn.OwnerItem.Owner?.Site is not null 1426if (item.Owner is ToolStrip owner) 1444&& parentToMoveOn.OwnerItem.Owner?.Site is not null 1707next = toolStripItem.Owner.Controls[0]; 1724next = ((ToolStripDropDown)toolStripItem.Owner).OwnerItem; 1728ToolStrip owner = toolStripItem.Owner; 1731next = toolStripItem.Owner; 1735next = toolStripItem.Owner; 1789ctl = templateNodeItem.Owner; 1850ToolStripItem parentItem = ((ToolStripDropDown)designerItem.Owner).OwnerItem; 1869if (item.Owner is ToolStrip owner)
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (28)
292if (toolItem.IsOnDropDown && toolItem.Owner is ToolStripDropDown dropDown) 333if (MenuItem.Owner is ToolStripDropDown dropDown) 428if (!(MenuItem.Owner is ToolStripDropDown) && base.Editor is not null) // we are on Base MenuStrip !! 932if (lastSelected.Owner is ToolStripDropDown lastDropDown && currentSelected.Owner is ToolStripDropDown currentDropDown) 966while (currentItem?.Owner is ToolStripDropDown dropDown) 1258selectedItem = ((ToolStripDropDown)item.Owner).OwnerItem as ToolStripDropDownItem; 1321if (MenuItem.Owner is ToolStripDropDown dropDown) 1373if (!(dropDownItem.Owner is ToolStripDropDownMenu) && dropDownItem is not null && dropDownItem.Bounds.Width < _commitedEditorNode.Bounds.Width) 1415return topMostItem.Owner; 1418return MenuItem.Owner; 1428if (MenuItem.Owner is ToolStripDropDown dropDown) 1438if (item.Owner is ToolStripDropDown itemDropDown) 1465if (item.Owner is ToolStripDropDown dropDown) 1614GetService<BehaviorService>()?.Invalidate(MenuItem.Owner.Bounds); 1622ToolStripDropDown startDropDown = MenuItem.Owner as ToolStripDropDown; 1627startDropDown = ownerItem.Owner as ToolStripDropDown; 1862if (e.Component is ToolStripItem itemAdding && itemAdding.Owner is null) 1879if (itemToBeDeleted.Owner is ToolStripDropDown owner) 1962if (itemToBeDeleted.Owner is ToolStripDropDown owner) 2160if (IsOnContextMenu && !MenuItem.Owner.Visible) 2210ToolStripDropDown parent = currentSelection.Owner as ToolStripDropDown; 2219parent = parent.OwnerItem.Owner as ToolStripDropDown; 2238ToolStripDropDown parent = item.Owner as ToolStripDropDown; 2247parent = parent.OwnerItem.Owner as ToolStripDropDown; 2497if (MenuItem.Owner is ToolStripDropDown dropDown) 2536ToolStripDropDown ownerDropDown = (ToolStripDropDown)MenuItem.Owner; 2558while (currentSelection is not null && currentSelection.Owner is ToolStripDropDown dropDown)
System.Windows.Forms.Tests (80)
System\Windows\Forms\ToolStripControlHostTests.cs (25)
1398Assert.Null(item.Owner); 1407Assert.Null(item.Owner); 1417Assert.Null(item.Owner); 1427Assert.Null(item.Owner); 1437Assert.Null(item.Owner); 1467Assert.Same(owner, item.Owner); 1478Assert.Same(owner, item.Owner); 1490Assert.Same(owner, item.Owner); 1502Assert.Same(owner, item.Owner); 1514Assert.Same(owner, item.Owner); 1537Assert.Null(item.Owner); 3066Assert.Null(item.Owner); 3086Assert.Same(owner, item.Owner); 3112Assert.Null(item.Owner); 3121Assert.Null(item.Owner); 3132Assert.Null(item.Owner); 3143Assert.Null(item.Owner); 3154Assert.Null(item.Owner); 3185Assert.Null(item.Owner); 3195Assert.Null(item.Owner); 3207Assert.Null(item.Owner); 3219Assert.Null(item.Owner); 3231Assert.Null(item.Owner); 3255Assert.Null(item.Owner); 3277Assert.Null(item.Owner);
System\Windows\Forms\ToolStripDropDownTests.cs (12)
3240Assert.Null(item1.Owner); 3241Assert.Null(item2.Owner); 3260Assert.Null(item1.Owner); 3261Assert.Null(item2.Owner); 3513Assert.Null(item1.Owner); 3514Assert.Null(item2.Owner); 3533Assert.Null(item1.Owner); 3534Assert.Null(item2.Owner); 3582Assert.Same(control, item1.Owner); 3583Assert.Same(control, item2.Owner); 3601Assert.Same(control, item1.Owner); 3602Assert.Same(control, item2.Owner);
System\Windows\Forms\ToolStripItemTests.cs (31)
6448Assert.Same(owner, item.Owner); 6455Assert.Same(owner, item.Owner); 6463Assert.Same(otherOwner, item.Owner); 6471Assert.Null(item.Owner); 6479Assert.Same(statusOwner, item.Owner); 6498Assert.Same(owner, item.Owner); 6505Assert.Same(owner, item.Owner); 6513Assert.Same(otherOwner, item.Owner); 6521Assert.Null(item.Owner); 6529Assert.Same(statusOwner, item.Owner); 6566Assert.Same(owner, item.Owner); 6572Assert.Same(owner, item.Owner); 6593Assert.Same(owner, item.Owner); 6599Assert.Same(owner, item.Owner); 6606Assert.Same(otherOwner, item.Owner); 6613Assert.Null(item.Owner); 6621Assert.Same(owner, item.Owner); 6976Assert.Null(item.Owner); 6984Assert.Null(item.Owner); 6992Assert.Null(item.Owner); 7000Assert.Null(item.Owner); 7008Assert.Null(item.Owner); 7033Assert.Null(item.Owner); 7041Assert.Null(item.Owner); 7049Assert.Null(item.Owner); 7057Assert.Null(item.Owner); 7065Assert.Null(item.Owner); 9931Assert.Null(item.Owner); 9939Assert.Null(item.Owner); 10084Assert.Equal(disposing, item.Owner is null); 10092Assert.Equal(disposing, item.Owner is null);
System\Windows\Forms\ToolStripTests.cs (12)
4499Assert.Null(item1.Owner); 4500Assert.Null(item2.Owner); 4519Assert.Null(item1.Owner); 4520Assert.Null(item2.Owner); 4667Assert.Null(item1.Owner); 4668Assert.Null(item2.Owner); 4687Assert.Null(item1.Owner); 4688Assert.Null(item2.Owner); 4736Assert.Same(control, item1.Owner); 4737Assert.Same(control, item2.Owner); 4755Assert.Same(control, item1.Owner); 4756Assert.Same(control, item2.Owner);