1 write to Component
System.ComponentModel.TypeConverter (1)
System\ComponentModel\Design\ComponentEventArgs.cs (1)
22Component = component;
88 references to Component
System.Windows.Forms (9)
System\Windows\Forms\ActiveX\AxHost.AxContainer.cs (1)
419if (sender == _associatedContainer && e.Component is AxHost control)
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (7)
2425if (e.Component is null) 2430if (!TypeDescriptorHelper.TryGetAttribute(e.Component.GetType(), out PropertyTabAttribute? tabAttribute)) 2440AddTab(tabAttribute.TabClasses[i], PropertyTabScope.Document, e.Component, setupToolbar: true); 2472if (e.Component is null) 2477if (!TypeDescriptorHelper.TryGetAttribute(e.Component.GetType(), out PropertyTabAttribute? tabAttribute)) 2487ReleaseTab(tabAttribute.TabClasses[i], e.Component); 2495if (e.Component == _selectedObjects[i])
System\Windows\Forms\Controls\WebBrowser\WebBrowserContainer.cs (1)
294if (sender == _associatedContainer && e.Component is Control c)
System.Windows.Forms.Design (65)
System\ComponentModel\Design\DesignerActionService.cs (1)
291Remove(componentEventArgs.Component!);
System\ComponentModel\Design\DesignerEventService.cs (1)
84if (ce.Component?.Site?.Container is IDesignerHost { Loading: true })
System\ComponentModel\Design\InheritanceService.cs (3)
262if (_addingComponent is not null && _addingComponent != ce.Component) 264_inheritedComponents[ce.Component!] = InheritanceAttribute.InheritedReadOnly; 269_inheritedComponents[ce.Component!] = _addingAttribute!;
System\ComponentModel\Design\ReferenceService.cs (2)
131IComponent compAdded = cevent.Component!; 146IComponent compRemoved = cevent.Component!;
System\ComponentModel\Design\SelectionService.cs (3)
110if (_selection is not null && ce.Component is not null && _selection.Contains(ce.Component)) 112RemoveSelection(ce.Component);
System\ComponentModel\Design\Serialization\CodeDomDesignerLoader.cs (1)
721string? name = e.Component!.Site!.Name;
System\ComponentModel\Design\Serialization\ComponentCache.cs (2)
193if (ce.Component is not null and not IExtenderProvider) 195RemoveEntry(ce.Component);
System\ComponentModel\Design\UndoEngine.cs (9)
336if (e.Component is not null) 338name = string.Format(SR.UndoEngineComponentAdd1, GetName(e.Component, true)); 412if (_refToRemovedComponent is not null && _refToRemovedComponent.Remove(e.Component!, out List<ReferencingComponent>? propsToUpdate)) 428if (e.Component is not null) 430name = string.Format(SR.UndoEngineComponentRemove1, GetName(e.Component, true)); 447if (comp == e.Component) 455if (prop.PropertyType.IsInstanceOfType(e.Component) && 469if (obj is not null && ReferenceEquals(obj, e.Component)) 477_refToRemovedComponent[e.Component] = propsToUpdate;
System\ComponentModel\Design\UndoEngine.UndoUnit.cs (8)
100if (e.Component!.Site?.Container is INestedContainer) 106AddEvent(new AddRemoveUndoEvent(UndoEngine, e.Component, true)); 109_ignoreAddingList?.Remove(e.Component); 113_ignoreAddedList.Add(e.Component); 123_ignoreAddingList.Add(e.Component!); 296if (_events[idx] is AddRemoveUndoEvent evt && evt.OpenComponent == e.Component) 335if (e.Component!.Site is INestedContainer) 344AddRemoveUndoEvent evt = new(UndoEngine, e.Component, false);
System\Windows\Forms\Design\Behavior\SelectionManager.cs (3)
247IComponent component = ce.Component!; 305_componentToDesigner.Remove(ce.Component!); 308_designerActionUI?.RemoveActionGlyph(ce.Component);
System\Windows\Forms\Design\BindingNavigatorDesigner.cs (1)
127ToolStripItem? item = e.Component as ToolStripItem;
System\Windows\Forms\Design\BindingSourceDesigner.cs (1)
57if (Component is BindingSource bindingSource && bindingSource.DataSource == e.Component)
System\Windows\Forms\Design\ComponentTray.cs (1)
296RemoveComponent(cevent.Component);
System\Windows\Forms\Design\ControlDesigner.cs (1)
540if (binding.DataSource == e.Component)
System\Windows\Forms\Design\DataGridViewDesigner.cs (2)
292if (e.Component is not null && e.Component == dataGridView.DataSource)
System\Windows\Forms\Design\DocumentDesigner.cs (5)
884IComponent component = ce.Component; 939bool designableAsControl = ce.Component is Control 940&& ce.Component is not ToolStrip 941&& !(ce.Component is Form form && form.TopLevel); 945_componentTray.RemoveComponent(ce.Component);
System\Windows\Forms\Design\FormDocumentDesigner.cs (5)
363if (ce.Component is ToolStrip && _toolStripAdornerWindowService is null && TryGetService(out IDesignerHost _)) 375if (ce.Component is ToolStrip && _toolStripAdornerWindowService is not null) 380if (ce.Component is IButtonControl) 382if (ce.Component == ShadowProperties[nameof(AcceptButton)]) 387if (ce.Component == ShadowProperties[nameof(CancelButton)])
System\Windows\Forms\Design\ParentControlDesigner.cs (2)
1323Control comp = e.Component as Control; 1340if (e.Component == _pendingRemoveControl)
System\Windows\Forms\Design\SelectionUIService.cs (3)
378_selectionHandlers.Remove(ce.Component!); 379_selectionItems.Remove(ce.Component!); 380((ISelectionUIService)this).SyncComponent(ce.Component);
System\Windows\Forms\Design\ToolStripDesigner.cs (6)
886if (_toolStripSelected && e.Component is ToolStrip) 894if (e.Component is ToolStripItem newItem && _addingItem && !newItem.IsOnDropDown) 982ToolStripItem addingItem = e.Component as ToolStripItem; 1033if (e.Component is ToolStripItem item && item.Owner == Component) 1110if (e.Component is ToolStripItem item && item.Owner == Component) 1118if (e.Component is ToolStripDropDownItem dropDownItem)
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (5)
1674if (e.Component is ToolStripItem newItem && _componentAddingFired && (MenuItemSelected || _fireComponentChanged)) 1848if (e.Component is ToolStripItem && (MenuItemSelected || _fireComponentChanged)) 1862if (e.Component is ToolStripItem itemAdding && itemAdding.Owner is null) 1877if (e.Component is ToolStripItem itemToBeDeleted && itemToBeDeleted.IsOnDropDown) 1960if (e.Component is ToolStripItem itemToBeDeleted && itemToBeDeleted.IsOnDropDown && itemToBeDeleted.Placement == ToolStripItemPlacement.Main)
System.Windows.Forms.Design.Tests (12)
System\ComponentModel\Design\DesignerHostTests.cs (6)
1608Assert.Same(component, e.Component); 1616Assert.Same(component, e.Component); 2791Assert.Same(component1, e.Component); 2792Assert.NotNull(e.Component.Site); 2801Assert.Same(component1, e.Component); 2802Assert.NotNull(e.Component.Site);
System\ComponentModel\Design\SiteNestedContainerTests.cs (6)
521Assert.Same(component, e.Component); 529Assert.Same(component, e.Component); 923Assert.Same(component1, e.Component); 924Assert.NotNull(e.Component.Site); 933Assert.Same(component1, e.Component); 934Assert.NotNull(e.Component.Site);
System.Windows.Forms.UI.IntegrationTests (2)
DesignBehaviorsTests.cs (2)
70if (e.Component is Form form) 77((Control)e.Component!).Size = new Size(50, 50);