Implemented interface member:
property
Component
System.ComponentModel.Design.IDesigner.Component
387 references to Component
DesignSurface (1)
CustomControls\CustomButtonDesigner.cs (1)
16new CustomButtonDesignerActionList(Component)
System.Windows.Forms.Design (359)
System\ComponentModel\Design\ComponentDesigner.cs (20)
83return root == Component ? null : root; 99_inheritanceAttribute = inheritanceService.GetInheritanceAttribute(Component); 186/// Controls whether the default property of <see cref="Component"/> is automatically set 336if (Component == comp) 356ebs.ShowCode(Component, thisDefaultEvent); 410PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(Component); 434props.Add(prop.Name, new(prop, Component)); 440TypeDescriptor.Refresh(Component); // force TypeDescriptor to re-query us. 471if (Component is IPersistComponentSettings) 477if (!_settingsKeyExplicitlySet && (e.Component == Component || e.Component == rootComponent)) 499if (Component is IPersistComponentSettings persistableComponent && rootComponent is not null) 503Debug.Assert(Component.Site is not null); 506settingsKeyName = $"{rootComponent.Site!.Name}.{Component.Site.Name}"; 510settingsKeyName = Component.Site.Name; 525if (Component is IPersistComponentSettings persistableComponent) 534if (Component is IPersistComponentSettings) 564ISite componentSite = Component.Site ?? throw new InvalidOperationException("Component should have a site"); 710if (Component is IPersistComponentSettings 726=> GetService<IComponentChangeService>()?.OnComponentChanged(Component, member, oldValue, newValue); 734=> GetService<IComponentChangeService>()?.OnComponentChanging(Component, member);
System\ComponentModel\Design\ComponentDesigner.ShadowPropertyCollection.cs (3)
39return property.GetValue(_designer.Component); 62descriptor = TypeDescriptor.GetProperties(_designer.Component.GetType())[propertyName]; 87return shadowedPropertyDescriptor.ShouldSerializeValue(_designer.Component);
System\Windows\Forms\Design\Behavior\DragAssistanceManager.cs (2)
607AddChildCompSnaplines(internalDesigner.Component, dragComponents, clipBounds, targetControl) && 608AddControlSnaplinesWhenResizing(internalDesigner, (Control)internalDesigner.Component, targetControl))
System\Windows\Forms\Design\Behavior\TableLayoutPanelBehavior.cs (1)
96selSvc?.SetSelectedComponents(new object[] { _designer.Component }, SelectionTypes.Primary);
System\Windows\Forms\Design\BindingNavigatorDesigner.cs (5)
53BindingNavigator navigator = (BindingNavigator)Component; 54IDesignerHost? host = Component?.Site?.GetService<IDesignerHost>(); 74BindingNavigator navigator = (BindingNavigator)Component; 131BindingNavigator navigator = (BindingNavigator)Component; 170BindingNavigator navigator = (BindingNavigator)Component;
System\Windows\Forms\Design\BindingSourceDesigner.cs (3)
45if (_bindingUpdatedByUser && e.Component == Component && 51dataSourceProviderService?.NotifyDataSourceComponentAdded(Component); 57if (Component is BindingSource bindingSource && bindingSource.DataSource == e.Component)
System\Windows\Forms\Design\ButtonBaseDesigner.cs (7)
27PropertyDescriptor? prop = TypeDescriptor.GetProperties(Component)["UseVisualStyleBackColor"]; 32if (!prop.ShouldSerializeValue(Component)) 34prop.SetValue(Component, true); 51PropertyDescriptorCollection props = TypeDescriptor.GetProperties(Component); 55Component, 60Component, 75Component,
System\Windows\Forms\Design\ChangeToolStripParentVerb.cs (3)
25_provider = designer.Component.Site; 46ToolStrip toolStrip = _designer.Component as ToolStrip; 47if (toolStrip is not null && _designer is not null && _designer.Component is not null && _provider is not null)
System\Windows\Forms\Design\CollectionEditVerbManager.cs (11)
34prop = TypeDescriptor.GetDefaultProperty(designer.Component); 72if (_designer.Component.Site is not null) 74return _designer.Component.Site.Container; 89void ITypeDescriptorContext.OnComponentChanged() => ChangeService.OnComponentChanged(_designer.Component, _targetProperty); 98ChangeService.OnComponentChanging(_designer.Component, _targetProperty); 118get => _designer.Component; 139if (_designer.Component.Site is not null) 141return _designer.Component.Site.GetService(serviceType); 178return dialog.ShowDialog(_designer.Component as IWin32Window); 188actionUIService?.HideUI(_designer.Component); 190object propertyValue = _targetProperty.GetValue(_designer.Component);
System\Windows\Forms\Design\ComboBoxDesigner.cs (5)
22public override ComboBox Control => (ComboBox)Component; 84PropertyDescriptor? textProp = TypeDescriptor.GetProperties(Component)["Text"]; 87textProp.SetValue(Component, string.Empty); 110PropertyDescriptorCollection props = TypeDescriptor.GetProperties(Component); 111if (props.TryGetPropertyDescriptorValue("DropDownStyle", Component, ref style))
System\Windows\Forms\Design\CommandSet.cs (1)
2017Component? parentComp = parentCompDesigner?.Component as Component;
System\Windows\Forms\Design\ContextMenuStripActionList.cs (2)
15: base(designer.Component) 17_toolStripDropDown = (ToolStripDropDown)designer.Component;
System\Windows\Forms\Design\ControlCommandSet.cs (1)
629dragManager = new DragAssistanceManager(des.Component.Site, selComps);
System\Windows\Forms\Design\ControlDesigner.ChildSubClass.cs (1)
66if (_designer is not null && _designer.Component is not null)
System\Windows\Forms\Design\ControlDesigner.ChildWindowTarget.cs (1)
39if (_designer.Component is null)
System\Windows\Forms\Design\ControlDesigner.cs (46)
136public virtual Control Control => (Control)Component; 160get => Component.Site?.Name; 165&& Component.Site is not null) 167Component.Site.Name = value; 178Component is Control c && c.Parent is not null ? c.Parent : base.ParentComponent; 202object component = Component; 217if (AutoResizeHandles && Component != _host?.RootComponent) 309object component = Component; 374Debug.Assert(Component is not null, "this.component needs to be set before this method is valid."); 375return TryGetService(out IDesignerHost? host) && Component == host.RootComponent; 530if (Component is not Control ctl) 669=> _moveBehavior ??= new ContainerSelectorBehavior(Control, Component.Site); 688if (parent is not null && _host is not null && _host.RootComponent != Component) 768if (TypeDescriptor.GetAttributes(Component).Contains(DesignTimeVisibleAttribute.Yes) 771Glyph? dapGlyph = designerActionUI.GetDesignerActionGlyph(Component); 826if (TypeDescriptor.GetAttributes(Component).Contains(DesignTimeVisibleAttribute.Yes) 829Glyph? dapGlyph = designerActionUI.GetDesignerActionGlyph(Component); 845internal virtual Behavior.Behavior StandardBehavior => _resizeBehavior ??= new ResizeBehavior(Component.Site); 934AttributeCollection attributes = TypeDescriptor.GetAttributes(Component); 944designerActionService.Add(Component, _dockingAction); 1001object component = Component; 1010object component = Component; 1042if (Component is Control ctl) 1138ISite? site = Component.Site; 1141PropertyDescriptor? textProp = TypeDescriptor.GetProperties(Component)["Text"]; 1144textProp.SetValue(Component, site.Name); 1159AttributeCollection attributes = TypeDescriptor.GetAttributes(Component); 1177PropertyDescriptor? dockProp = TypeDescriptor.GetProperties(Component)["Dock"]; 1180dockProp.SetValue(Component, DockStyle.Fill); 1198ISite? site = Component.Site; 1201PropertyDescriptor? textProp = TypeDescriptor.GetProperties(Component)["Text"]; 1204textProp.SetValue(Component, site.Name); 1312selectionService.SetSelectedComponents(new object[] { Component }, SelectionTypes.Primary); 1335|| (selectionService is not null && !selectionService.GetComponentSelected(Component)))) 1337selectionService?.SetSelectedComponents(new object[] { Component }, SelectionTypes.Primary); 1401if (TryGetService(out ISelectionService? selectionService) && !Component.Equals(selectionService.PrimarySelection)) 1403selectionService.SetSelectedComponents(new object[] { Component }, SelectionTypes.Primary | SelectionTypes.Toggle); 1595_hasLocation = TypeDescriptor.GetProperties(Component)["Location"] is not null; 1830mouseHandler.OnMouseHover(Component); 1856mouseHandler.OnMouseDoubleClick(Component); 1882mouseHandler.OnMouseDoubleClick(Component); 1919mouseHandler.OnMouseDown(Component, button, location.X, location.Y); 1928new object[] { Component }, 1968mouseHandler.OnMouseMove(Component, location.X, location.Y); 1999mouseHandler.OnMouseUp(Component, button); 2140mouseHandler.OnSetCursor(Component);
System\Windows\Forms\Design\ControlDesigner.DockingActionList.cs (1)
16: base(owner.Component)
System\Windows\Forms\Design\DataGridViewColumnDesigner.cs (10)
26DataGridViewColumn col = (DataGridViewColumn)Component; 34DataGridViewColumn? col = (DataGridViewColumn)Component; 83if ((host is null || (host is not null && !host.Loading)) && Component.Site is not null) 85Component.Site.Name = value; 125DataGridViewColumn col = (DataGridViewColumn)Component; 130DataGridViewColumn col = (DataGridViewColumn)Component; 214&& Component.Equals(_selectionService.PrimarySelection)) 244if (Component.Site is null) 275DataGridViewColumn col = (DataGridViewColumn)Component; 288return _initializing ? (Component != host.RootComponent) // for non root components, respect the name that the base Control serialized unless changed
System\Windows\Forms\Design\DataGridViewComboBoxColumnDesigner.cs (6)
20DataGridViewComboBoxColumn dataGridViewComboBoxColumn = (DataGridViewComboBoxColumn)Component; 25DataGridViewComboBoxColumn dataGridViewComboBoxColumn = (DataGridViewComboBoxColumn)Component; 42DataGridViewComboBoxColumn dataGridViewComboBoxColumn = (DataGridViewComboBoxColumn)Component; 47DataGridViewComboBoxColumn dataGridViewComboBoxColumn = (DataGridViewComboBoxColumn)Component; 62DataGridViewComboBoxColumn dataGridViewComboBoxColumn = (DataGridViewComboBoxColumn)Component; 68DataGridViewComboBoxColumn dataGridViewComboBoxColumn = (DataGridViewComboBoxColumn)Component;
System\Windows\Forms\Design\DataGridViewDesigner.cs (10)
16public override DataGridView Control => (DataGridView)Component; 742IDesignerHost? host = Component.Site?.GetService<IDesignerHost>(); 770IDesignerHost? host = Component.Site?.GetService<IDesignerHost>(); 798if (Component.Site.TryGetService(out IUIService? service)) 813public DataGridViewChooseDataSourceActionList(DataGridViewDesigner owner) : base(owner.Component) 825RelatedComponent = _owner.Component 848changeService?.OnComponentChanging(_owner.Component, dataSourceProp); 851changeService?.OnComponentChanged(_owner.Component, dataSourceProp, null, null); 866public DataGridViewColumnEditingActionList(DataGridViewDesigner owner) : base(owner.Component) 897public DataGridViewPropertiesActionList(DataGridViewDesigner owner) : base(owner.Component)
System\Windows\Forms\Design\DocumentDesigner.cs (17)
512Point loc = BehaviorService.ControlToAdornerWindow((Control)Component); 513Rectangle translatedBounds = new(loc, ((Control)Component).Size); 517PropertyDescriptor prop = TypeDescriptor.GetProperties(Component)["Locked"]; 520locked = (bool)prop.GetValue(Component); 524prop = TypeDescriptor.GetProperties(Component)["AutoSize"]; 527autoSize = (bool)prop.GetValue(Component); 531prop = TypeDescriptor.GetProperties(Component)["AutoSizeMode"]; 534mode = (AutoSizeMode)prop.GetValue(Component); 676PropertyDescriptor backProp = TypeDescriptor.GetProperties(Component.GetType())["BackColor"]; 677if (backProp is not null && backProp.PropertyType == typeof(Color) && !backProp.ShouldSerializeValue(Component)) 708_behaviorService = new BehaviorService(Component.Site, _frame); 903_componentTray = new ComponentTray(this, Component.Site); 978if (selSvc.SelectionCount == 1 && selSvc.GetComponentSelected(Component)) 1032return new ToolStripAdornerWindowService(Component.Site, _frame); 1115ss.SetSelectedComponents(new object[] { Component }, SelectionTypes.Replace); 1116Debug.Assert(ss.PrimarySelection == Component, "Bug in selection service: form should have primary selection."); 1195if (obj != Component)
System\Windows\Forms\Design\EditorServiceContext.cs (8)
27prop = TypeDescriptor.GetDefaultProperty(designer.Component); 76IContainer? ITypeDescriptorContext.Container => _designer.Component.Site?.Container; 80=> ChangeService.OnComponentChanged(_designer.Component, _targetProperty); 87ChangeService.OnComponentChanging(_designer.Component, _targetProperty); 96object ITypeDescriptorContext.Instance => _designer.Component; 107return _designer.Component?.Site?.GetService(serviceType); 132return dialog.ShowDialog(_designer.Component as IWin32Window); 141object? propertyValue = _targetProperty?.GetValue(_designer.Component);
System\Windows\Forms\Design\FlowLayoutPanelDesigner .cs (3)
591PropertyDescriptor controlsProperty = TypeDescriptor.GetProperties(Component)["Controls"]; 629List<IComponent> tempList = DesignerUtils.CopyDragObjects(_dragControls, Component.Site); 724PropertyDescriptor controlsProperty = TypeDescriptor.GetProperties(Component)["Controls"];
System\Windows\Forms\Design\FormDocumentDesigner.cs (9)
35((Form)Component).AcceptButton = value; 49((Form)Component).CancelButton = value; 65SizeF real = Form.GetAutoScaleSize(((Form)Component).Font); 89return !_initializing && ((Form)Component).AutoScale && ShadowProperties.Contains(nameof(AutoScaleBaseSize)); 107if (Component is Form form) 131((Form)Component).ClientSize = value; 236PropertyDescriptorCollection props = TypeDescriptor.GetProperties(Component); 237changeService?.OnComponentChanging(Component, props["ClientSize"]); 240changeService?.OnComponentChanged(Component, props["ClientSize"]);
System\Windows\Forms\Design\ImageListActionList.cs (1)
15: base(designer.Component)
System\Windows\Forms\Design\ImageListDesigner.cs (1)
51internal ImageList ImageList => (ImageList)Component;
System\Windows\Forms\Design\LabelDesigner.cs (7)
35PropertyDescriptorCollection props = TypeDescriptor.GetProperties(Component); 39Component, 48Component, 56Component, 74int offset = (int)(info.Invoke(Component, parameters: null) ?? 0); 147PropertyDescriptorCollection props = TypeDescriptor.GetProperties(Component); 150Component,
System\Windows\Forms\Design\ListBoxDesigner.cs (10)
25ListBox listBox = (ListBox)Component; 39return ((ListBox)Component).Dock; 43ListBox listBox = (ListBox)Component; 123((ListBox)Component).FormattingEnabled = true; 128if (TypeDescriptorHelper.TryGetPropertyValue(Component, nameof(ListBox.Name), out string? name) 141if (e.Component == Component && e.NewName is not null) 153if (e.Component == Component 156&& TypeDescriptorHelper.TryGetPropertyValue(Component, nameof(ListBox.Name), out string? name) 170if (TypeDescriptorHelper.TryGetPropertyValue(Component, nameof(ListBox.Name), out string? name) 198if (Component is CheckedListBox)
System\Windows\Forms\Design\ListControlUnboundActionList.cs (1)
13: base(designer.Component)
System\Windows\Forms\Design\ListViewActionList.cs (1)
15: base(designer.Component)
System\Windows\Forms\Design\ListViewDesigner.cs (6)
59return ((ListView)Component).View; 63((ListView)Component).View = value; 75ListView listView = (ListView)Component; 145GetService<IComponentChangeService>().OnComponentChanged(Component); 157ShowErrorDialog(Component.Site.GetService<IUIService>(), ex, (ListView)Component);
System\Windows\Forms\Design\MaskedTextBoxDesignerActionList.cs (2)
26: base(designer.Component) 28_maskedTextBox = (MaskedTextBox)designer.Component;
System\Windows\Forms\Design\NotifyIconDesigner.cs (1)
16NotifyIcon icon = (NotifyIcon)Component;
System\Windows\Forms\Design\NotifyIconDesignerActionList.cs (1)
11public NotifyIconActionList(NotifyIconDesigner designer) : base(designer.Component)
System\Windows\Forms\Design\PanelDesigner.cs (2)
30Panel panel = (Panel)Component; // if the panel is invisible, bail now 53Panel panel = (Panel)Component;
System\Windows\Forms\Design\ParentControlDesigner.cs (21)
120_defaultUseSnapLines = DesignerUtils.UseSnapLines(Component.Site); 348private IServiceProvider ServiceProvider => Component is not null ? Component.Site : (IServiceProvider)null; 488if (primarySelection == Component || selectedControl is null) 866IContainer container = Component.Site.Container; 1001if (parent is not null && host is not null && host.RootComponent != Component) 1041Point loc = BehaviorService.ControlToAdornerWindow((Control)Component); 1042Rectangle translatedBounds = new(loc, ((Control)Component).Size); 1052ContainerSelectorBehavior behavior = new((Control)Component, Component.Site, true); 1391data.Target = Component; 1458behDataObject.Target = Component; 1460newTarget = !(data.Source.Equals(Component)); // Check if we are moving to a new target 1590_toolboxItemSnapLineBehavior ??= new ToolboxItemSnapLineBehavior(Component.Site, BehaviorService, this, AllowGenericDragBox); 1634sel?.SetSelectedComponents(new object[] { Component }, SelectionTypes.Replace); 1659data.Target = Component; 1734selsvc?.SetSelectedComponents(new object[] { Component }, SelectionTypes.Primary); 1931_dragManager = new DragAssistanceManager(Component.Site); 2298return Component; 2309IContainer container = DesignerUtils.CheckForNestedContainer(Component.Site.Container); // ...necessary to support SplitterPanel components 2356string error = string.Format(SR.DesignerCantParentType, component.GetType().Name, Component.GetType().Name);
System\Windows\Forms\Design\PictureBoxActionList.cs (2)
15: base(designer.Component) 18_pictureBox = (PictureBox)designer.Component;
System\Windows\Forms\Design\PictureBoxDesigner.cs (3)
67PictureBox pictureBox = (PictureBox)Component; 88PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(Component); 92Component,
System\Windows\Forms\Design\PrintDialogDesigner.cs (1)
21if (Component is PrintDialog dialog)
System\Windows\Forms\Design\RadioButtonDesigner.cs (2)
21PropertyDescriptor? prop = TypeDescriptor.GetProperties(Component)["TabStop"]; 24prop.SetValue(Component, true);
System\Windows\Forms\Design\RichTextBoxActionList.cs (1)
13: base(designer.Component)
System\Windows\Forms\Design\SplitContainerDesigner.cs (1)
326var uiService = (IUIService?)Component?.Site?.GetService(typeof(IUIService));
System\Windows\Forms\Design\SplitContainerDesigner.OrientationActionList.cs (2)
21: base(owner.Component) 24_ownerComponent = owner.Component as Component;
System\Windows\Forms\Design\SplitterDesigner.cs (1)
46if (((Splitter)Component).BorderStyle == BorderStyle.None)
System\Windows\Forms\Design\StandardMenuStripVerb.cs (9)
32_provider = designer.Component.Site; 43actionUIService?.HideUI(_designer.Component); 49if (_designer.Component is MenuStrip menuStrip) 55CreateStandardToolStrip(_host, (ToolStrip)_designer.Component); 246selSvc?.SetSelectedComponents(new object[] { _designer.Component }); 250actionUIService?.Refresh(_designer.Component); 390selSvc?.SetSelectedComponents(new object[] { _designer.Component }); 394actionUIService?.Refresh(_designer.Component); 483string nameOfRandomItem = ToolStripDesigner.NameFromText(null, typeof(ToolStripMenuItem), _designer.Component.Site);
System\Windows\Forms\Design\TabControlDesigner.cs (11)
99MemberDescriptor member = TypeDescriptor.GetProperties(component: Component)["Controls"]; 103TabControl tc = (TabControl)Component; 240TabControl tc = (TabControl)Component; 250t = host.CreateTransaction(string.Format(SR.TabControlAddTab, Component.Site.Name)); 323TabControl tc = (TabControl)Component; 332MemberDescriptor member = TypeDescriptor.GetProperties(Component)["Controls"]; 345t = host.CreateTransaction(string.Format(SR.TabControlRemoveTab, ((IComponent)tp).Site.Name, Component.Site.Name)); 408TabControl tabControl = (TabControl)Component; 440TabControl tabControl = (TabControl)Component; 455svc.SetSelectedComponents(new object[] { Component }); 485TabPage selectedTab = ((TabControl)Component).SelectedTab;
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (16)
53private TableLayoutPanelBehavior Behavior => _tlpBehavior ??= new TableLayoutPanelBehavior(Table, this, Component.Site); 126_designerContextMenuStrip = new BaseContextMenuStrip(Component.Site); 208internal TableLayoutPanel Table => Component as TableLayoutPanel; 263actionUIService?.Refresh(Component); 389public TableLayouPanelRowColumnActionList(TableLayoutPanelDesigner owner) : base(owner.Component) 564temp = DesignerUtils.CopyDragObjects(temp, Component.Site); 1063PropertyDescriptor prop = TypeDescriptor.GetProperties(Component)["Locked"]; 1064bool locked = (prop is not null) && ((bool)prop.GetValue(Component)); 1397if (_extenderProperties is null && Component is not null) 1401AttributeCollection attribs = TypeDescriptor.GetAttributes(Component.GetType()); 1433if (changingControl is not null && changingControl.Parent == Component && 1436PropertyDescriptor controlsProp = TypeDescriptor.GetProperties(Component)["Controls"]; 1437_compSvc.OnComponentChanging(Component, controlsProp); 1459if (c is not null && c.Parent == Component && 1462PropertyDescriptor controlsProp = TypeDescriptor.GetProperties(Component)["Controls"]; 1463_compSvc.OnComponentChanged(Component, controlsProp, null, null);
System\Windows\Forms\Design\TextBoxActionList.cs (2)
14: base(designer.Component) 16_textBox = (TextBox)designer.Component;
System\Windows\Forms\Design\TextBoxBaseDesigner.cs (6)
31PropertyDescriptorCollection props = TypeDescriptor.GetProperties(Component); 34Component, 77return TypeDescriptor.GetProperties(typeof(TextBoxBase))["Text"]!.ShouldSerializeValue(Component); 93PropertyDescriptor? textProp = TypeDescriptor.GetProperties(Component)["Text"]; 96textProp.SetValue(Component, string.Empty); 129object component = Component;
System\Windows\Forms\Design\ToolStripActionList.cs (2)
18: base(designer.Component) 20_toolStrip = (ToolStrip)designer.Component;
System\Windows\Forms\Design\ToolStripContainerDesigner.cs (4)
47((ToolStripContainer)Component).TopToolStripPanelVisible = value; 61((ToolStripContainer)Component).LeftToolStripPanelVisible = value; 75((ToolStripContainer)Component).RightToolStripPanelVisible = value; 89((ToolStripContainer)Component).BottomToolStripPanelVisible = value;
System\Windows\Forms\Design\ToolStripContentPanelDesigner.cs (2)
18if (_contextMenu is null && Component.Site is { } site) 58ToolStripContentPanel? panel = Component as ToolStripContentPanel;
System\Windows\Forms\Design\ToolStripDesigner.cs (17)
411get => (ToolStrip)Component; 425_keyboardHandlingService ??= new ToolStripKeyboardHandlingService(Component.Site); 574IComponent component = _host.CreateComponent(t, NameFromText(text, t, Component.Site)); 728_tn = new ToolStripTemplateNode(Component, SR.ToolStripDesignerTemplateNodeEnterText); 908RaiseComponentChanging(TypeDescriptor.GetProperties(Component)["Items"]); 930RaiseComponentChanged(TypeDescriptor.GetProperties(Component)["Items"], null, null); 1033if (e.Component is ToolStripItem item && item.Owner == Component) 1042RaiseComponentChanged(TypeDescriptor.GetProperties(Component)["Items"], null, null); 1110if (e.Component is ToolStripItem item && item.Owner == Component) 1117RaiseComponentChanging(TypeDescriptor.GetProperties(Component)["Items"]); 1368Point loc = BehaviorService.ControlToAdornerWindow((Control)Component); 1369Rectangle translatedBounds = new(loc, ((Control)Component).Size); 1377ContainerSelectorBehavior behavior = new(ToolStrip, Component.Site, true); 1440new EditorServiceContext(this, TypeDescriptor.GetProperties(Component)["Items"], SR.ToolStripItemCollectionEditorVerb); 1445new ToolStripKeyboardHandlingService(Component.Site); 1451new ToolStripInSituService(Component.Site); 1877components = DesignerUtils.CopyDragObjects(dragComponents, Component.Site);
System\Windows\Forms\Design\ToolStripDropDownDesigner.cs (17)
80get => ((ToolStrip)Component).Items; 164if (Component is IPersistComponentSettings persistableComponent && _host is not null) 171ShadowProperties[SettingsKeyName] = $"{rootComponent.Site.Name}.{Component.Site.Name}"; 175ShadowProperties[SettingsKeyName] = Component.Site.Name; 189if (Component is IPersistComponentSettings persistableComponent) 358inSituService ??= new ToolStripInSituService(Component.Site); 360_dropDown = (ToolStripDropDown)Component; 394Name = Component.Site.Name 408new EditorServiceContext(this, TypeDescriptor.GetProperties(Component)["Items"], SR.ToolStripItemCollectionEditorVerb); 497bool showDesignMenu = IsContextMenuStripItemSelected(selectionService) || Component.Equals(selectionService.PrimarySelection); 509if (Component is null || _menuItem is null) 518selectionService.SetSelectedComponents(new IComponent[] { Component }, SelectionTypes.Replace); 522if (Component.Equals(selectionService.PrimarySelection) && _selected) 527bool showDesignMenu = IsContextMenuStripItemSelected(selectionService) || Component.Equals(selectionService.PrimarySelection); 574if (Component is IPersistComponentSettings) 711private bool ShouldSerializeSettingsKey() => Component is IPersistComponentSettings persistableComponent 735if (_selectionService is not null && Component.Equals(_selectionService.PrimarySelection))
System\Windows\Forms\Design\ToolStripDropDownItemDesigner.cs (1)
28if (Component is ToolStripDropDownItem item && item.DropDown.IsAutoGenerated)
System\Windows\Forms\Design\ToolStripItemDesigner.cs (11)
81BaseContextMenuStrip toolStripContextMenu = new(Component.Site); 93_toolStripItemCustomMenuItemCollection ??= new ToolStripItemCustomMenuItemCollection(Component.Site, ToolStripItem); 226get => (ToolStripItem)Component; 677ISite site = Component.Site; 678if (site is not null && Component is ToolStripDropDownItem) 683IComponent component = Component; 700if (Component is ToolStripTextBox or ToolStripComboBox) 702PropertyDescriptor textProp = TypeDescriptor.GetProperties(Component)["Text"]; 705textProp.SetValue(Component, string.Empty); 762serializationService.Serialize(serializedData, Component); // notice the use of component... since we want to preserve the type. 1216IDesignerHost designerHost = (IDesignerHost)Component.Site.GetService(typeof(IDesignerHost));
System\Windows\Forms\Design\ToolStripKeyboardHandlingService.cs (1)
534SelectionService.SetSelectedComponents(new object[] { dropDownDesigner.Component }, SelectionTypes.Replace);
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (3)
304&& menuStrip.OwnerItem == Component 375_typeHereTemplateNode = new ToolStripTemplateNode(Component, SR.ToolStripDesignerTemplateNodeEnterText); 750_commitedTemplateNode = new ToolStripTemplateNode(Component, text)
System\Windows\Forms\Design\ToolStripPanelDesigner.cs (8)
66ISite? site = Component.Site; 88public override ToolStripPanel Control => (ToolStripPanel)Component; 255if (_containerSelectorGlyph is null && Component.Site is not null) 258_behavior = new ToolStripPanelSelectionBehavior(Control, Component.Site); 259_containerSelectorGlyph = new ToolStripPanelSelectionGlyph(Rectangle.Empty, Cursors.Default, Control, Component.Site, _behavior); 286if (_containerSelectorGlyph is null && Component.Site is not null) 289_behavior = new ToolStripPanelSelectionBehavior(Control, Component.Site); 290_containerSelectorGlyph = new ToolStripPanelSelectionGlyph(Rectangle.Empty, Cursors.Default, Control, Component.Site, _behavior);
System\Windows\Forms\Design\TrackBarDesigner.cs (2)
22if (GetPropertyValue<bool>(Component, nameof(TrackBar.AutoSize))) 24var orientation = GetPropertyValue<Orientation?>(Component, nameof(TrackBar.Orientation)) ?? Orientation.Horizontal;
System\Windows\Forms\Design\TreeViewActionList.cs (2)
15: base(designer.Component) 18_treeView = (TreeView)designer.Component;
System\Windows\Forms\Design\UpDownBaseDesigner.cs (2)
47PropertyDescriptorCollection props = TypeDescriptor.GetProperties(Component); 50Component,
System.Windows.Forms.Design.Tests (27)
ControlDesignerTests.cs (2)
40IComponent component = controlDesigner.Component; 360{ nameof(mockParentDesigner.Object.Component), new Control() }
System\ComponentModel\Design\ComponentDesignerTests.cs (24)
22Assert.Throws<InvalidOperationException>(() => designer.Component); 549Assert.Same(mockComponent.Object, designer.Component); 552Assert.Throws<InvalidOperationException>(() => designer.Component); 557Assert.Throws<InvalidOperationException>(() => designer.Component); 606Assert.Same(component, designer.Component); 609Assert.Throws<InvalidOperationException>(() => designer.Component); 613Assert.Throws<InvalidOperationException>(() => designer.Component); 621Assert.Throws<InvalidOperationException>(() => designer.Component); 625Assert.Throws<InvalidOperationException>(() => designer.Component); 641Assert.Same(mockComponent.Object, designer.Component); 646Assert.Throws<InvalidOperationException>(() => designer.Component); 650Assert.Same(mockComponent.Object, designer.Component); 659Assert.Throws<InvalidOperationException>(() => designer.Component); 663Assert.Same(mockComponent.Object, designer.Component); 689Assert.Same(component, designer.Component); 694Assert.Throws<InvalidOperationException>(() => designer.Component); 698Assert.Same(component, designer.Component); 705Assert.Throws<InvalidOperationException>(() => designer.Component); 709Assert.Same(component, designer.Component); 719Assert.Throws<InvalidOperationException>(() => designer.Component); 723Assert.Throws<InvalidOperationException>(() => designer.Component); 2006Assert.Same(component, designer.Component); 2014Assert.Throws<InvalidOperationException>(() => designer.Component); 2131Assert.Same(component, designer.Component);
System\Windows\Forms\Design\ImageListActionListTests.cs (1)
35_actionList.Component.Should().Be(_imageListDesigner.Component);