1 interface inheriting from IDesignerHost
System.ComponentModel.TypeConverter (1)
System\ComponentModel\Design\Serialization\IDesignerLoaderHost.cs (1)
16public interface IDesignerLoaderHost : IDesignerHost
1024 references to IDesignerHost
DesignSurface (3)
CustomControls\CustomButtonDesignerActionList.cs (3)
12private readonly IDesignerHost _host; 20_host = GetService(typeof(IDesignerHost)) as IDesignerHost;
DesignSurfaceExt (11)
DesignSurfaceExt.cs (7)
97IDesignerHost host = GetIDesignerHost(); 118IDesignerHost ihost = GetIDesignerHost(); 167IComponent newComp = CreateComponent<TControl>(out IDesignerHost host); 203private TComponent CreateComponent<TComponent>(out IDesignerHost host) 232public IDesignerHost GetIDesignerHost() => (IDesignerHost)GetService(typeof(IDesignerHost));
IDesignSurfaceExt.cs (1)
36IDesignerHost GetIDesignerHost();
PropertyGridExt.cs (2)
12private IDesignerHost _host; 40public IDesignerHost DesignerHost
TabOrderHooker.cs (1)
17public void HookTabOrder(IDesignerHost host)
netstandard (1)
netstandard.cs (1)
255[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.ComponentModel.Design.IDesignerHost))]
System (1)
src\libraries\shims\System\ref\System.cs (1)
241[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.ComponentModel.Design.IDesignerHost))]
System.ComponentModel.TypeConverter (31)
System\ComponentModel\AmbientValueAttribute.cs (4)
21private static readonly object? s_throwSentinel = IDesignerHost.IsSupported ? null : new(); 33Debug.Assert(IDesignerHost.IsSupported, "Runtime instantiation of this attribute is not allowed with trimming."); 34if (!IDesignerHost.IsSupported) 147if (!IDesignerHost.IsSupported && ReferenceEquals(_value, s_throwSentinel))
System\ComponentModel\Design\ActiveDesignerEventArgs.cs (4)
16public ActiveDesignerEventArgs(IDesignerHost? oldDesigner, IDesignerHost? newDesigner) 25public IDesignerHost? OldDesigner { get; } 30public IDesignerHost? NewDesigner { get; }
System\ComponentModel\Design\DesignerCollection.cs (5)
17/// that stores an array with a pointer to each <see cref='System.ComponentModel.Design.IDesignerHost'/> 20public DesignerCollection(IDesignerHost[]? designers) 34/// that stores an array with a pointer to each <see cref='System.ComponentModel.Design.IDesignerHost'/> 50public virtual IDesignerHost? this[int index] => (IDesignerHost?)_designers[index];
System\ComponentModel\Design\DesignerEventArgs.cs (2)
16public DesignerEventArgs(IDesignerHost? host) 24public IDesignerHost? Designer { get; }
System\ComponentModel\Design\IComponentDiscoveryService.cs (1)
19ICollection GetComponentTypes(IDesignerHost? designerHost, Type? baseType);
System\ComponentModel\Design\IDesignerEventService.cs (1)
14IDesignerHost? ActiveDesigner { get; }
System\ComponentModel\Design\IDesignerHost.cs (7)
52/// Adds an event handler for the <see cref='System.ComponentModel.Design.IDesignerHost.Activated'/> event. 57/// Adds an event handler for the <see cref='System.ComponentModel.Design.IDesignerHost.Deactivated'/> event. 62/// Adds an event handler for the <see cref='System.ComponentModel.Design.IDesignerHost.LoadComplete'/> event. 67/// Adds an event handler for the <see cref='System.ComponentModel.Design.IDesignerHost.TransactionClosed'/> event. 72/// Adds an event handler for the <see cref='System.ComponentModel.Design.IDesignerHost.TransactionClosing'/> event. 77/// Adds an event handler for the <see cref='System.ComponentModel.Design.IDesignerHost.TransactionOpened'/> event. 82/// Adds an event handler for the <see cref='System.ComponentModel.Design.IDesignerHost.TransactionOpening'/> event.
System\ComponentModel\ToolboxItemAttribute.cs (1)
45if (!IDesignerHost.IsSupported)
System\ComponentModel\TypeDescriptor.cs (3)
652IDesignerHost? host = site.GetService(typeof(IDesignerHost)) as IDesignerHost;
System\Timers\Timer.cs (3)
222IDesignerHost? host = (IDesignerHost?)GetService(typeof(IDesignerHost));
System.Windows.Forms (28)
System\Windows\Forms\ActiveX\AxHost.cs (2)
1989if (Site.TryGetService(out IDesignerHost? host) && host.RootComponent is ContainerControl rootControl) 3018Site.TryGetService(out IDesignerHost? host);
System\Windows\Forms\Control.cs (1)
5249&& site.TryGetService(out IDesignerHost? host)
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (9)
62private IDesignerHost? _designerHost; 243internal IDesignerHost? ActiveDesigner 245get => _designerHost ??= GetService<IDesignerHost>(); 1160ActiveDesigner = value?.GetService<IDesignerHost>(); 1483IDesignerHost? host = null; 1486host = site.GetService<IDesignerHost>(); 1641private PropertyTab? CreateTab(Type tabType, IDesignerHost? host) 1662constructor = tabType.GetConstructor([typeof(IDesignerHost)]); 1768if (_selectedObjects.Length == 1 && site.TryGetService(out IDesignerHost? designerHost))
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\CommandsPane.cs (1)
20/// <see cref="IDesigner.Verbs"/> from any associated <see cref="IDesignerHost"/>. Note that
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (3)
238/// The currently active <see cref="IDesignerHost"/>, if any. 246internal virtual IDesignerHost? DesignerHost 890IDesignerHost? currentHost,
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\MultiPropertyDescriptorGridEntry.cs (1)
274IDesignerHost? host = DesignerHost;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\MultiSelectRootGridEntry.cs (1)
22IDesignerHost? host,
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyDescriptorGridEntry.cs (2)
568IDesignerHost? host = DesignerHost; 827IDesignerHost? host = DesignerHost;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\SingleSelectRootGridEntry.cs (3)
18private IDesignerHost? _host; 30IDesignerHost? host, 114internal sealed override IDesignerHost? DesignerHost
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.cs (1)
1140if (Site.TryGetService(out IDesignerHost? host) && host.RootComponent is ContainerControl rootContainerControl)
System\Windows\Forms\Design\EventsTab.cs (2)
16private IDesignerHost? _currentHost; 52/// This looks first at the current <see cref="IDesignerHost"/>, then the <paramref name="object"/>'s
System\Windows\Forms\ErrorProvider\ErrorProvider.cs (2)
98if (value.GetService(typeof(IDesignerHost)) is IDesignerHost host)
System.Windows.Forms.Design (625)
System\ComponentModel\Design\BinaryEditor.cs (1)
27return _context.TryGetService(out IDesignerHost? designerhost)
System\ComponentModel\Design\CollectionEditor.cs (5)
95if (Context.TryGetService(out IDesignerHost? host) && typeof(IComponent).IsAssignableFrom(itemType)) 124nameof(IDesignerHost), 201if (Context.TryGetService(out IDesignerHost? host)) 238IDesignerHost? host = Context?.GetService<IDesignerHost>();
System\ComponentModel\Design\ComponentDesigner.cs (9)
82IComponent? root = GetService<IDesignerHost>()?.RootComponent; 196if (comps is not null && comps.Count > 0 && TryGetService(out IDesignerHost? host)) 225if (parent is not null && TryGetService(out IDesignerHost? host)) 259IDesignerHost? host = GetService<IDesignerHost>(); 368return TryGetService(out IDesignerHost? host) && _component == host.RootComponent; 383bool isRoot = TryGetService(out IDesignerHost? host) && component == host.RootComponent; 473IComponent? rootComponent = GetService<IDesignerHost>()?.RootComponent; 497IComponent? rootComponent = GetService<IDesignerHost>()?.RootComponent;
System\ComponentModel\Design\DataSourceProviderService.cs (1)
22public abstract object AddDataSourceInstance(IDesignerHost host, DataSourceDescriptor dataSourceDescriptor);
System\ComponentModel\Design\DesignerActionPanel.cs (2)
621IDesignerHost? host = serviceProvider.GetService<IDesignerHost>();
System\ComponentModel\Design\DesignerActionService.cs (4)
36IDesignerHost? host = serviceProvider.GetService<IDesignerHost>(); 133IDesignerHost? host = _serviceProvider.GetService<IDesignerHost>();
System\ComponentModel\Design\DesignerActionUI.cs (6)
279IDesignerHost? host = _serviceProvider.GetService<IDesignerHost>(); 302IDesignerHost host = _serviceProvider.GetRequiredService<IDesignerHost>(); 538if (_serviceProvider.TryGetService(out IDesignerHost? host) && host.InTransaction) 549if (_serviceProvider.TryGetService(out IDesignerHost? host))
System\ComponentModel\Design\DesignerActionUIService.cs (4)
20IDesignerHost host = serviceProvider.GetRequiredService<IDesignerHost>(); 34IDesignerHost? host = _serviceProvider.GetService<IDesignerHost>();
System\ComponentModel\Design\DesignerEventService.cs (14)
19private List<IDesignerHost>? _designerList; // read write list used as data for the collection 21private IDesignerHost? _activeDesigner; // the currently active designer. Can be null 40IDesignerHost? host = null; 43host = surface.GetService(typeof(IDesignerHost)) as IDesignerHost; 58IDesignerHost? oldDesigner = _activeDesigner; 84if (ce.Component?.Site?.Container is IDesignerHost { Loading: true }) 120IDesignerHost? host = surface.GetService<IDesignerHost>(); 146IDesignerHost? host = surface.GetService<IDesignerHost>(); 239IDesignerHost? host = provider.GetService<IDesignerHost>(); 300IDesignerHost? IDesignerEventService.ActiveDesigner => _activeDesigner;
System\ComponentModel\Design\DesignerHost.cs (42)
27private static readonly Type[] s_defaultServices = [typeof(IDesignerHost), typeof(IContainer), typeof(IComponentChangeService), typeof(IDesignerLoaderHost2)]; 715DesignerTransaction t = ((IDesignerHost)this).CreateTransaction(); 850if (!((IDesignerHost)this).Loading) 860if (!((IDesignerHost)this).Loading) 866bool IDesignerHost.Loading => 869bool IDesignerHost.InTransaction => (_transactions is not null && _transactions.Count > 0) || IsClosingTransaction; 871IContainer IDesignerHost.Container => this; 873IComponent IDesignerHost.RootComponent => _rootComponent!; 875string IDesignerHost.RootComponentClassName => _rootComponentClassName!; 877string IDesignerHost.TransactionDescription => 882event EventHandler IDesignerHost.Activated 888event EventHandler IDesignerHost.Deactivated 894event EventHandler IDesignerHost.LoadComplete 900event DesignerTransactionCloseEventHandler IDesignerHost.TransactionClosed 906event DesignerTransactionCloseEventHandler IDesignerHost.TransactionClosing 912event EventHandler IDesignerHost.TransactionOpened 918event EventHandler IDesignerHost.TransactionOpening 924void IDesignerHost.Activate() => _surface?.OnViewActivate(); 928IComponent IDesignerHost.CreateComponent(Type componentType) => 929((IDesignerHost)this).CreateComponent(componentType, null!); 931IComponent IDesignerHost.CreateComponent(Type componentType, string name) 991DesignerTransaction IDesignerHost.CreateTransaction() => 992((IDesignerHost)this).CreateTransaction(SR.DesignerHostGenericTransactionName); 994DesignerTransaction IDesignerHost.CreateTransaction(string description) => 997void IDesignerHost.DestroyComponent(IComponent component) 1012if (((IDesignerHost)this).InTransaction) 1020using (t = ((IDesignerHost)this).CreateTransaction(string.Format(SR.DesignerHostDestroyComponentTransaction, name))) 1032IDesigner? IDesignerHost.GetDesigner(IComponent component) 1039Type? IDesignerHost.GetType(string typeName) 1100IRootDesigner rootDesigner = (((IDesignerHost)this).GetDesigner(_rootComponent!) as IRootDesigner) 1208typeof(IDesignerHost).GetMethod(name, bindingAttr, binder, types, modifiers); 1211MethodInfo? IReflect.GetMethod(string name, BindingFlags bindingAttr) => typeof(IDesignerHost).GetMethod(name, bindingAttr); 1214MethodInfo[] IReflect.GetMethods(BindingFlags bindingAttr) => typeof(IDesignerHost).GetMethods(bindingAttr); 1217FieldInfo? IReflect.GetField(string name, BindingFlags bindingAttr) => typeof(IDesignerHost).GetField(name, bindingAttr); 1220FieldInfo[] IReflect.GetFields(BindingFlags bindingAttr) => typeof(IDesignerHost).GetFields(bindingAttr); 1223PropertyInfo? IReflect.GetProperty(string name, BindingFlags bindingAttr) => typeof(IDesignerHost).GetProperty(name, bindingAttr); 1227typeof(IDesignerHost).GetProperty(name, bindingAttr, binder, returnType, types, modifiers); 1230PropertyInfo[] IReflect.GetProperties(BindingFlags bindingAttr) => typeof(IDesignerHost).GetProperties(bindingAttr); 1246MemberInfo[] IReflect.GetMember(string name, BindingFlags bindingAttr) => typeof(IDesignerHost).GetMember(name, bindingAttr); 1249MemberInfo[] IReflect.GetMembers(BindingFlags bindingAttr) => typeof(IDesignerHost).GetMembers(bindingAttr); 1261typeof(IDesignerHost).InvokeMember(name, invokeAttr, binder, target, args, modifiers, culture, namedParameters); 1263Type IReflect.UnderlyingSystemType => typeof(IDesignerHost).UnderlyingSystemType;
System\ComponentModel\Design\DesignSurface.cs (4)
76return ((IDesignerHost)_host).Container; 130IComponent? rootComponent = ((IDesignerHost)_host).RootComponent; 156if (((IDesignerHost)_host).GetDesigner(rootComponent) is not IRootDesigner rootDesigner) 443IComponent? rootComponent = ((IDesignerHost)_host).RootComponent;
System\ComponentModel\Design\DesignSurfaceCollection.cs (3)
35IDesignerHost host = _designers[index]!; 85IDesignerHost host = (IDesignerHost)_designerEnumerator.Current!;
System\ComponentModel\Design\EventBindingService.EventPropertyDescriptor.cs (1)
213if (site.TryGetService(out IDesignerHost? host))
System\ComponentModel\Design\MenuCommandService.cs (1)
197if (_selectionService?.SelectionCount == 1 && TryGetService(out IDesignerHost? designerHost))
System\ComponentModel\Design\SelectionService.cs (6)
69if (GetService(typeof(IDesignerHost)) is IDesignerHost host) 223if (GetService(typeof(IDesignerHost)) is IDesignerHost host && _selection.Contains(host.RootComponent)) 273if (GetService(typeof(IDesignerHost)) is IDesignerHost host)
System\ComponentModel\Design\Serialization\CodeDomDesignerLoader.cs (1)
97if (TryGetService(out IDesignerHost? host))
System\ComponentModel\Design\Serialization\CodeDomDesignerLoader.ModifiersExtenderProvider.cs (2)
18private IDesignerHost? _host; 51_host ??= component.Site?.GetService<IDesignerHost>();
System\ComponentModel\Design\Serialization\CodeDomDesignerLoader.ModifiersInheritedExtenderProvider.cs (2)
19private IDesignerHost? _host; 58_host ??= component.Site?.GetService<IDesignerHost>();
System\ComponentModel\Design\Serialization\CodeDomLocalizationProvider.LanguageExtenders.cs (2)
21private readonly IDesignerHost? _host; 30_host = serviceProvider.GetService<IDesignerHost>();
System\ComponentModel\Design\Serialization\CodeDomSerializerBase.cs (1)
684if (manager.GetService<IDesignerHost>() is { } host)
System\ComponentModel\Design\Serialization\DesignerSerializationManager.cs (5)
60/// for <see cref="IDesignerHost"/> in the service provider and uses its container if it exists. 68if (GetService(typeof(IDesignerHost)) is IDesignerHost host) 261if (GetService(typeof(IDesignerHost)) is IDesignerHost host && host.Container == Container)
System\ComponentModel\Design\ToolStripContainerActionList.cs (2)
16private readonly IDesignerHost? _designerHost; 26_designerHost = _serviceProvider?.GetService<IDesignerHost>();
System\ComponentModel\Design\TypeDescriptorFilterService.cs (1)
27if (site.TryGetService(out IDesignerHost? host))
System\ComponentModel\Design\UndoEngine.cs (2)
23private readonly IDesignerHost _host; 44_host = GetRequiredService<IDesignerHost>();
System\ComponentModel\Design\UndoEngine.UndoUnit.AddRemoveUndoEvent.cs (4)
76IDesignerHost host = engine.GetRequiredService<IDesignerHost>(); 84IDesignerHost host = engine.GetRequiredService<IDesignerHost>();
System\ComponentModel\Design\UndoEngine.UndoUnit.ChangeUndoEvent.cs (2)
117else if (engine.TryGetService(out IDesignerHost? host)) 158if (engine.TryGetService(out IDesignerHost? host))
System\Drawing\Design\IToolboxService.cs (10)
38void AddCreator(ToolboxItemCreatorCallback creator, string format, IDesignerHost host); 43void AddLinkedToolboxItem(ToolboxItem toolboxItem, IDesignerHost host); 48void AddLinkedToolboxItem(ToolboxItem toolboxItem, string category, IDesignerHost host); 68ToolboxItem DeserializeToolboxItem(object serializedObject, IDesignerHost host); 78ToolboxItem GetSelectedToolboxItem(IDesignerHost host); 88ToolboxItemCollection GetToolboxItems(IDesignerHost host); 98ToolboxItemCollection GetToolboxItems(string category, IDesignerHost host); 105bool IsSupported(object serializedObject, IDesignerHost host); 122bool IsToolboxItem(object serializedObject, IDesignerHost host); 137void RemoveCreator(string format, IDesignerHost host);
System\Drawing\Design\ToolboxComponentsCreatingEventArgs.cs (2)
17public ToolboxComponentsCreatingEventArgs(IDesignerHost? host) 26public IDesignerHost? DesignerHost { get; }
System\Drawing\Design\ToolboxItem.cs (6)
222public IComponent[]? CreateComponents(IDesignerHost? host) 239public IComponent[]? CreateComponents(IDesignerHost? host, IDictionary? defaultValues) 255protected virtual IComponent[]? CreateComponentsCore(IDesignerHost? host) 278protected virtual IComponent[]? CreateComponentsCore(IDesignerHost? host, IDictionary? defaultValues) 437public Type? GetType(IDesignerHost? host) => GetType(host, AssemblyName, TypeName, false); 446protected virtual Type? GetType(IDesignerHost? host, AssemblyName? assemblyName, string typeName, bool reference)
System\Windows\Forms\Design\BaseContextMenuStrip.cs (2)
83if (_serviceProvider.GetService(typeof(ISelectionService)) is ISelectionService selectionService && _serviceProvider.GetService(typeof(IDesignerHost)) is IDesignerHost host)
System\Windows\Forms\Design\Behavior\BehaviorService.cs (6)
82IDesignerHost? host = serviceProvider.GetService<IDesignerHost>(); 171_serviceProvider.GetService(typeof(IDesignerHost)) is IDesignerHost host) 789IDesignerHost? host = _serviceProvider.GetService<IDesignerHost>();
System\Windows\Forms\Design\Behavior\ContainerSelectorBehavior.cs (3)
207IDesignerHost host = (IDesignerHost)_serviceProvider.GetService(typeof(IDesignerHost));
System\Windows\Forms\Design\Behavior\DragAssistanceManager.cs (5)
149if (!(serviceProvider.GetService(typeof(IDesignerHost)) is IDesignerHost host) || _behaviorService is null) 487if (_serviceProvider.GetService(typeof(IDesignerHost)) is IDesignerHost host) 522private void Initialize(List<IComponent>? dragComponents, IDesignerHost host)
System\Windows\Forms\Design\Behavior\DropSourceBehavior.cs (9)
68private readonly IDesignerHost _srcHost; 69private IDesignerHost _destHost; 100_srcHost = (IDesignerHost)_serviceProviderSource.GetService(typeof(IDesignerHost)); 316_destHost = (IDesignerHost)_serviceProviderTarget.GetService(typeof(IDesignerHost)); 649IDesignerHost newDestHost = (IDesignerHost)_serviceProviderTarget.GetService(typeof(IDesignerHost));
System\Windows\Forms\Design\Behavior\ResizeBehavior.cs (5)
216if (_serviceProvider.GetService(typeof(IDesignerHost)) is IDesignerHost designerHost) 233IDesignerHost host = (IDesignerHost)_serviceProvider.GetService(typeof(IDesignerHost));
System\Windows\Forms\Design\Behavior\SelectionManager.cs (2)
25private IDesignerHost _designerHost; 50_designerHost = serviceProvider.GetRequiredService<IDesignerHost>();
System\Windows\Forms\Design\Behavior\TableLayoutPanelBehavior.cs (3)
116IDesignerHost host = _serviceProvider.GetService(typeof(IDesignerHost)) as IDesignerHost;
System\Windows\Forms\Design\Behavior\ToolboxItemSnapLineBehavior.cs (3)
344IDesignerHost host = (IDesignerHost)_serviceProvider.GetService(typeof(IDesignerHost));
System\Windows\Forms\Design\Behavior\ToolStripPanelSelectionBehavior.cs (3)
136var host = _serviceProvider.GetRequiredService<IDesignerHost>(); 265IDesignerHost host = _serviceProvider.GetRequiredService<IDesignerHost>();
System\Windows\Forms\Design\Behavior\ToolStripPanelSelectionGlyph.cs (2)
34IDesignerHost? host = _provider?.GetService<IDesignerHost>();
System\Windows\Forms\Design\BindingNavigatorDesigner.cs (4)
54IDesignerHost? host = Component?.Site?.GetService<IDesignerHost>(); 95private void SiteItem(IDesignerHost? host, ToolStripItem item) 117private void SiteItems(IDesignerHost? host, ToolStripItemCollection items)
System\Windows\Forms\Design\ChangeToolStripParentVerb.cs (2)
18private readonly IDesignerHost _host; 26_host = _provider.GetService<IDesignerHost>();
System\Windows\Forms\Design\CommandSet.cs (37)
66if (site.TryGetService(out IDesignerHost? host)) 376if (site.TryGetService(out IDesignerHost? host)) 456if (TryGetService(out IDesignerHost? host)) 499IDesignerHost? host = site.GetService<IDesignerHost>(); 515private static void GetAssociatedComponents(IComponent component, IDesignerHost host, List<IComponent> list) 599protected virtual void GetSnapInformation(IDesignerHost host, IComponent component, out Size snapSize, out IComponent snapComponent, out PropertyDescriptor? snapProperty) 685if (TryGetService(out IToolboxService? tbx) && tbx.GetSelectedToolboxItem(GetService<IDesignerHost>()) is not null) 717if (TryGetService(out IDesignerHost? host)) 734if (SelectionService?.PrimarySelection is IComponent comp && TryGetService(out IDesignerHost? host) && 986IDesignerHost? host = GetService<IDesignerHost>(); 1131IDesignerHost? host = GetService<IDesignerHost>(); 1254IDesignerHost? host = GetService<IDesignerHost>(); 1466if (TryGetService(out IDesignerHost? host)) 1583if (site is null || SelectionService is null || !TryGetService(out IDesignerHost? host)) 1841if (!TryGetService(out IDesignerHost? host)) 2195if (site is null || SelectionService is null || !TryGetService(out IDesignerHost? host)) 2241if (site is null || !TryGetService(out IDesignerHost? host)) 2315IDesignerHost? host = GetService<IDesignerHost>(); 2382IDesignerHost? host = GetService<IDesignerHost>(); 2477if (site.TryGetService(out IDesignerHost? host)) 2520IDesignerHost? host = GetService<IDesignerHost>(); 2899IDesignerHost? designerHost = GetService<IDesignerHost>(); 2993&& TryGetService(out IDesignerHost? host) 3047if (TryGetService(out IDesignerHost? host)) 3079if (TryGetService(out IDesignerHost? host) 3128IDesignerHost host = GetService<IDesignerHost>()!; 3342IDesignerHost? host = GetService<IDesignerHost>();
System\Windows\Forms\Design\ComponentTray.cs (46)
85IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 278IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 301IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 317IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 405IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 515IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 682IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 751IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 860IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 1078IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 1124_mouseDragTool = _toolboxService.DeserializeToolboxItem(de.Data, (IDesignerHost)GetService(typeof(IDesignerHost))); 1234ToolboxItem tool = _toolboxService.GetSelectedToolboxItem((IDesignerHost)GetService(typeof(IDesignerHost))); 1532IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 1695IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 2092IDesignerHost host = (IDesignerHost)_tray.GetService(typeof(IDesignerHost)); 2495IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost));
System\Windows\Forms\Design\ControlCodeDomSerializer.cs (3)
177IDesignerHost? host = manager.GetService<IDesignerHost>(); 220private void SerializeControlHierarchy(IDesignerSerializationManager manager, IDesignerHost host, object? value)
System\Windows\Forms\Design\ControlCommandSet.cs (32)
278IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 367protected override void GetSnapInformation(IDesignerHost host, IComponent component, out Size snapSize, out IComponent snapComponent, out PropertyDescriptor snapProperty) 522IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 850IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 942IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 954_tabOrder = new TabOrder((IDesignerHost)GetService(typeof(IDesignerHost))); 984IDesignerHost designerHost = (IDesignerHost)GetService(typeof(IDesignerHost)); 1194IDesignerHost host = (IDesignerHost)site.GetService(typeof(IDesignerHost)); 1254if (site.TryGetService(out IDesignerHost host) 1271if (site.TryGetService(out IDesignerHost host) 1293IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 1368IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 1436IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost));
System\Windows\Forms\Design\ControlDesigner.ControlDesignerAccessibleObject.cs (3)
15private IDesignerHost? _host; 28private IDesignerHost DesignerHost => _host ??= _designer.GetRequiredService<IDesignerHost>();
System\Windows\Forms\Design\ControlDesigner.cs (7)
23private IDesignerHost? _host; // the host for our designer 164if ((!TryGetService(out IDesignerHost? host) || (host is not null && !host.Loading)) 375return TryGetService(out IDesignerHost? host) && Component == host.RootComponent; 931_host = GetService<IDesignerHost>(); 1149&& TryGetService(out IDesignerHost? host)) 1673_host ??= GetService<IDesignerHost>(); 1896if (_toolboxService?.GetSelectedToolboxItem(GetService<IDesignerHost>()) is not null)
System\Windows\Forms\Design\ControlDesigner.DockingActionList.cs (3)
13private readonly IDesignerHost? _host; 18_host = GetService(typeof(IDesignerHost)) as IDesignerHost;
System\Windows\Forms\Design\DataGridViewAddColumnDialog.cs (6)
155IDesignerHost? host = _liveDataGridView.Site?.GetService<IDesignerHost>(); 635if (_liveDataGridView.Site.TryGetService(out IDesignerHost? host)) 660if (!_liveDataGridView.Site.TryGetService(out IDesignerHost? host)) 770IDesignerHost? host = _liveDataGridView.Site?.GetService<IDesignerHost>();
System\Windows\Forms\Design\DataGridViewColumnDesigner.cs (3)
49IDesignerHost? host = null; 54host = dataGridView.Site.GetService<IDesignerHost>(); 281if (!TryGetService(out IDesignerHost? host))
System\Windows\Forms\Design\DataGridViewColumnTypeEditor.cs (3)
29IDesignerHost? host = provider.GetService(typeof(IDesignerHost)) as IDesignerHost;
System\Windows\Forms\Design\DataGridViewDesigner.cs (16)
533IDesignerHost? host = site?.GetService<IDesignerHost>(); 742IDesignerHost? host = Component.Site?.GetService<IDesignerHost>(); 770IDesignerHost? host = Component.Site?.GetService<IDesignerHost>(); 842IDesignerHost? host = dataGridView.Site?.GetService<IDesignerHost>(); 921IDesignerHost? host = dataGridView.Site?.GetService<IDesignerHost>(); 964IDesignerHost? host = dataGridView.Site?.GetService<IDesignerHost>(); 1007IDesignerHost? host = dataGridView.Site?.GetService<IDesignerHost>(); 1050IDesignerHost? host = dataGridView.Site?.GetService<IDesignerHost>();
System\Windows\Forms\Design\DataSourceProviderService.cs (1)
20public abstract object AddDataSourceInstance(IDesignerHost? host, DataSourceDescriptor dataSourceDescriptor);
System\Windows\Forms\Design\DesignBindingPicker.cs (2)
101private IDesignerHost? _designerHost; // Service that provides access to current WinForms designer session 388_designerHost = _serviceProvider.GetService<IDesignerHost>();
System\Windows\Forms\Design\DesignerExtenders.NameExtenderProvider.cs (3)
34IDesignerHost? host = (IDesignerHost?)site.GetService(typeof(IDesignerHost));
System\Windows\Forms\Design\DesignerUtils.cs (5)
617public static string? GetUniqueSiteName(IDesignerHost host, string? name) 744IDesignerHost? host = svcProvider.GetService<IDesignerHost>(); 790private static List<IComponent> GetCopySelection(IReadOnlyList<IComponent> objects, IDesignerHost host) 802internal static void GetAssociatedComponents(IComponent component, IDesignerHost? host, List<IComponent> list)
System\Windows\Forms\Design\DocumentDesigner.AxToolboxItem.cs (3)
61protected override IComponent[] CreateComponentsCore(IDesignerHost? host) 161private Type? GetAxTypeFromReference(object reference, IDesignerHost host) 220private static object? GetReferences(IDesignerHost host)
System\Windows\Forms\Design\DocumentDesigner.cs (28)
115IDesignerHost host = GetService(typeof(IDesignerHost)) as IDesignerHost; 266IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 341IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 625IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 682IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 840if (GetService(typeof(IDesignerHost)) is IDesignerHost host) 879if (!TryGetService(out IDesignerHost host)) 953IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 989IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 1104((IDesignerHost)sender).LoadComplete -= OnLoadComplete; 1376IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost));
System\Windows\Forms\Design\FlowLayoutPanelDesigner .cs (1)
567DesignerTransaction designerTransaction = TryGetService(out IDesignerHost host)
System\Windows\Forms\Design\FormDocumentDesigner.cs (7)
130GetService<IDesignerHost>(); 289IDesignerHost host = GetService<IDesignerHost>(); 335IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 363if (ce.Component is ToolStrip && _toolStripAdornerWindowService is null && TryGetService(out IDesignerHost _))
System\Windows\Forms\Design\OleDragDropHandler.CfCodeToolboxItem.cs (2)
75protected override IComponent[]? CreateComponentsCore(IDesignerHost? host, IDictionary? defaultValues) 147protected override IComponent[]? CreateComponentsCore(IDesignerHost? host) => CreateComponentsCore(host, null);
System\Windows\Forms\Design\OleDragDropHandler.ComponentDataObject.cs (4)
99IDesignerHost? host = _serviceProvider.GetService<IDesignerHost>(); 117private static void GetAssociatedComponents(IComponent component, IDesignerHost host, List<IComponent> list) 212IDesignerHost? host = null;
System\Windows\Forms\Design\OleDragDropHandler.cs (5)
144IDesignerHost? host = GetService<IDesignerHost>(); 522if (TryGetService(out IDesignerHost? host)) 667IDesignerHost host = GetService<IDesignerHost>()!;
System\Windows\Forms\Design\ParentControlDesigner.cs (50)
188IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 267IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 405IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 454IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 598private void AddChildComponents(IComponent component, IContainer container, IDesignerHost host) 690IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 896IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 999IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 1063_oleDragDropHandler ??= new OleDragDropHandler(null, (IServiceProvider)GetService(typeof(IDesignerHost)), this); 1076IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 1209IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 1247if (GetService(typeof(IDesignerHost)) is not IDesignerHost host) 1422IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 1491IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 1611private void PerformDragEnter(DragEventArgs de, IDesignerHost host) 1676IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 1719_mouseDragTool = _toolboxService.GetSelectedToolboxItem((IDesignerHost)GetService(typeof(IDesignerHost))); 2132private void ReParentControls(Control newParent, List<Control> controls, string transactionName, IDesignerHost host) 2313IDesignerHost localDesignerHost = (IDesignerHost)GetService(typeof(IDesignerHost)); 2473IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost));
System\Windows\Forms\Design\SelectionUIHandler.cs (2)
336IDesignerHost? host = GetService<IDesignerHost>();
System\Windows\Forms\Design\SelectionUIService.cs (2)
53private readonly IDesignerHost _host; 60public SelectionUIService(IDesignerHost host) : base()
System\Windows\Forms\Design\SplitContainerDesigner.cs (3)
22private IDesignerHost? _designerHost; 239_designerHost = (IDesignerHost?)component.Site?.GetService(typeof(IDesignerHost));
System\Windows\Forms\Design\SplitterPanelDesigner.cs (3)
19private IDesignerHost? _designerHost; 110_designerHost = (IDesignerHost?)component.Site?.GetService(typeof(IDesignerHost));
System\Windows\Forms\Design\StandardMenuStripVerb.cs (5)
21private readonly IDesignerHost _host; 33_host = (IDesignerHost)_provider.GetService(typeof(IDesignerHost)); 67private void CreateStandardMenuStrip(IDesignerHost host, MenuStrip tool) 261private void CreateStandardToolStrip(IDesignerHost host, ToolStrip tool)
System\Windows\Forms\Design\StyleEditorForm.cs (4)
102var host = _tableLayoutPanel.Site.GetService<IDesignerHost>(); 1061var host = _tableLayoutPanel.Site.GetService<IDesignerHost>();
System\Windows\Forms\Design\TabControlDesigner.cs (12)
131IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 242IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 337IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 488IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost));
System\Windows\Forms\Design\TableLayoutPanelCodeDomSerializer.cs (3)
48IDesignerHost? host = manager.GetService<IDesignerHost>(); 67private static bool IsLocalizable([NotNullWhen(true)] IDesignerHost? host)
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (35)
93IDesignerHost host = GetService(typeof(IDesignerHost)) as IDesignerHost; 197IDesignerHost host = GetService(typeof(IDesignerHost)) as IDesignerHost; 502IDesignerHost host = GetService(typeof(IDesignerHost)) as IDesignerHost; 521IDesignerHost host = GetService(typeof(IDesignerHost)) as IDesignerHost; 549IDesignerHost host = GetService(typeof(IDesignerHost)) as IDesignerHost; 799IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 1159IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 1537if (tbx is not null && tbx.GetSelectedToolboxItem((IDesignerHost)GetService(typeof(IDesignerHost))) is not null) 1636IDesignerHost host = GetService(typeof(IDesignerHost)) as IDesignerHost; 1751IDesignerHost host = GetService(typeof(IDesignerHost)) as IDesignerHost; 1875IDesignerHost host = GetService(typeof(IDesignerHost)) as IDesignerHost; 1972IDesignerHost host = GetService(typeof(IDesignerHost)) as IDesignerHost;
System\Windows\Forms\Design\TabOrder.cs (2)
20private IDesignerHost _host; 42public TabOrder(IDesignerHost host)
System\Windows\Forms\Design\TemplateNodeCustomMenuItemCollection.cs (3)
65IDesignerHost designerHost = (IDesignerHost)_serviceProvider.GetService(typeof(IDesignerHost));
System\Windows\Forms\Design\ToolStripContainerDesigner.cs (3)
33/// The <see cref="IDesignerHost"/> that owns this designer. 35private IDesignerHost _designerHost => GetRequiredService<IDesignerHost>();
System\Windows\Forms\Design\ToolStripDesigner.cs (2)
45private IDesignerHost _host; // get private copy of the DesignerHost 1423_host = GetRequiredService<IDesignerHost>();
System\Windows\Forms\Design\ToolStripDesignerUtils.cs (3)
440IDesignerHost designerHost = (IDesignerHost)provider.GetService(typeof(IDesignerHost));
System\Windows\Forms\Design\ToolStripDropDownDesigner.cs (3)
23private IDesignerHost _host; 350_host = (IDesignerHost)GetService(typeof(IDesignerHost));
System\Windows\Forms\Design\ToolStripEditorManager.cs (3)
24private readonly IDesignerHost _designerHost; 40_designerHost = (IDesignerHost)comp.Site.GetService(typeof(IDesignerHost));
System\Windows\Forms\Design\ToolStripInSituService.cs (6)
18private readonly IDesignerHost _designerHost; 31_designerHost = (IDesignerHost)provider.GetService(typeof(IDesignerHost)); 85IDesignerHost host = (IDesignerHost)_sp.GetService(typeof(IDesignerHost));
System\Windows\Forms\Design\ToolStripItemBehavior.cs (19)
77IDesignerHost designerHost = (IDesignerHost)item.Site.GetService(typeof(IDesignerHost)); 153private static Rectangle GetPaintingBounds(IDesignerHost designerHost, ToolStripItem item) 293IDesignerHost designerHost = (IDesignerHost)glyphItem.Site.GetService(typeof(IDesignerHost)); 547IDesignerHost designerHost = (IDesignerHost)glyphItem.Site.GetService(typeof(IDesignerHost)); 651IDesignerHost designerHost = (IDesignerHost)currentDropItem.Site.GetService(typeof(IDesignerHost)); 916IDesignerHost designerHost = (IDesignerHost)item.Site.GetService(typeof(IDesignerHost)); 974IDesignerHost designerHost = (IDesignerHost)glyphItem.Site.GetService(typeof(IDesignerHost));
System\Windows\Forms\Design\ToolStripItemCustomMenuItemCollection.cs (21)
207IDesignerHost _designerHost = (IDesignerHost)_serviceProvider.GetService(typeof(IDesignerHost)); 233IDesignerHost _designerHost = (IDesignerHost)_serviceProvider.GetService(typeof(IDesignerHost)); 304IDesignerHost _designerHost = (IDesignerHost)_serviceProvider.GetService(typeof(IDesignerHost)); 372IDesignerHost designerHost = (IDesignerHost)_serviceProvider.GetService(typeof(IDesignerHost)); 434IDesignerHost designerHost = (IDesignerHost)_serviceProvider.GetService(typeof(IDesignerHost)); 473IDesignerHost designerHost = (IDesignerHost)_serviceProvider.GetService(typeof(IDesignerHost)); 512IDesignerHost designerHost = (IDesignerHost)_serviceProvider.GetService(typeof(IDesignerHost));
System\Windows\Forms\Design\ToolStripItemDesigner.cs (9)
247if (!TryGetService(out IDesignerHost designerHost)) 333IDesignerHost designerHost = GetService<IDesignerHost>(); 716if (!TryGetService(out IDesignerHost host)) 988if (TryGetService(out IDesignerHost designerHost) && currentSelection.Owner is ToolStripDropDown parentDropDown) 1058if (!TryGetService(out IDesignerHost host)) 1216IDesignerHost designerHost = (IDesignerHost)Component.Site.GetService(typeof(IDesignerHost));
System\Windows\Forms\Design\ToolStripKeyboardHandlingService.cs (9)
20private readonly IDesignerHost _designerHost; 62_designerHost = (IDesignerHost)_provider.GetService(typeof(IDesignerHost)); 129private IDesignerHost Host 597IDesignerHost host = Host; 839IDesignerHost host = Host; 914IDesignerHost host = Host; 1672IDesignerHost host = Host; 1763IDesignerHost host = Host;
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (5)
32private IDesignerHost _designerHost; 1519_designerHost = GetService<IDesignerHost>(); 2682IDesignerHost host = (IDesignerHost)primaryItem.Site.GetService(typeof(IDesignerHost));
System\Windows\Forms\Design\ToolStripPanelDesigner.cs (2)
22private IDesignerHost? _designerHost; 324_designerHost = component.Site?.GetService<IDesignerHost>();
System\Windows\Forms\Design\ToolStripTemplateNode.cs (2)
50private readonly IDesignerHost _designerHost; 123_designerHost = component.Site.GetService<IDesignerHost>();
System.Windows.Forms.Design.Tests (255)
Mocks\MockSite.cs (1)
16.Setup(s => s.GetService(typeof(IDesignerHost)))
SplitContainerDesignerTests.cs (1)
15Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict);
System\ComponentModel\Design\CollectionEditorTests.cs (24)
163.Setup(c => c.GetService(typeof(IDesignerHost))) 205Mock<IDesignerHost> mockHost = new(MockBehavior.Strict); 221.Setup(c => c.GetService(typeof(IDesignerHost))) 252Mock<IDesignerHost> mockHost = new(MockBehavior.Strict); 272.Setup(c => c.GetService(typeof(IDesignerHost))) 309Mock<IDesignerHost> mockHost = new(MockBehavior.Strict); 325.Setup(c => c.GetService(typeof(IDesignerHost))) 419.Setup(c => c.GetService(typeof(IDesignerHost))) 459Mock<IDesignerHost> mockHost = new(MockBehavior.Strict); 472.Setup(c => c.GetService(typeof(IDesignerHost))) 533.Setup(c => c.GetService(typeof(IDesignerHost))) 564Mock<IDesignerHost> mockHost = new(MockBehavior.Strict); 574.Setup(c => c.GetService(typeof(IDesignerHost))) 610Mock<IDesignerHost> mockHost = new(MockBehavior.Strict); 620.Setup(c => c.GetService(typeof(IDesignerHost))) 657Mock<IDesignerHost> mockHost = new(MockBehavior.Strict); 667.Setup(c => c.GetService(typeof(IDesignerHost))) 700Mock<IDesignerHost> mockHost = new(MockBehavior.Strict); 710.Setup(c => c.GetService(typeof(IDesignerHost))) 737.Setup(c => c.GetService(typeof(IDesignerHost))) 738.Returns((IDesignerHost)null); 852.Setup(c => c.GetService(typeof(IDesignerHost))) 960.Setup(c => c.GetService(typeof(IDesignerHost))) 998.Setup(c => c.GetService(typeof(IDesignerHost)))
System\ComponentModel\Design\CollectionFormTests.cs (15)
120.Setup(c => c.GetService(typeof(IDesignerHost))) 176.Setup(c => c.GetService(typeof(IDesignerHost))) 235.Setup(c => c.GetService(typeof(IDesignerHost))) 294.Setup(c => c.GetService(typeof(IDesignerHost))) 353.Setup(c => c.GetService(typeof(IDesignerHost))) 407.Setup(c => c.GetService(typeof(IDesignerHost))) 513.Setup(c => c.GetService(typeof(IDesignerHost))) 556Mock<IDesignerHost> mockHost = new(MockBehavior.Strict); 572.Setup(c => c.GetService(typeof(IDesignerHost))) 604Mock<IDesignerHost> mockHost = new(MockBehavior.Strict); 624.Setup(c => c.GetService(typeof(IDesignerHost))) 662Mock<IDesignerHost> mockHost = new(MockBehavior.Strict); 678.Setup(c => c.GetService(typeof(IDesignerHost))) 734.Setup(c => c.GetService(typeof(IDesignerHost))) 773.Setup(c => c.GetService(typeof(IDesignerHost)))
System\ComponentModel\Design\ComponentDesignerTests.cs (98)
46var service = designer.GetService<IDesignerHost>(); 52service = designer.GetService<IDesignerHost>(); 55Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 63service = designer.GetService<IDesignerHost>(); 82Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 105Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 143Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 207.Setup(s => s.GetService(typeof(IDesignerHost))) 308Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 320mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once()); 324mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(2)); 329mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(3)); 338Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 345mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once()); 349mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(2)); 354mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(3)); 377mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once()); 380mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(2)); 384mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(3)); 393Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 409mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once()); 414mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(rootComponent is null ? 2 : 3)); 420mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(rootComponent is null ? 3 : 5)); 431Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 438mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once()); 442mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(2)); 447mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(3)); 465mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once()); 468mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(2)); 472mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(3)); 481Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 488.Setup(s => s.GetService(typeof(IDesignerHost))) 527mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once()); 530mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(3)); 534mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(4)); 572.Setup(s => s.GetService(typeof(IDesignerHost))) 793Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 803.Setup(s => s.GetService(typeof(IDesignerHost))) 908Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 918.Setup(s => s.GetService(typeof(IDesignerHost))) 956mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(2)); 969mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(3)); 1017Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 1027.Setup(s => s.GetService(typeof(IDesignerHost))) 1069mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(2)); 1093mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(3)); 1125Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 1135.Setup(s => s.GetService(typeof(IDesignerHost))) 1175mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(2)); 1186mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(3)); 1218Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 1228.Setup(s => s.GetService(typeof(IDesignerHost))) 1268mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(2)); 1279mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(3)); 1309Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 1319.Setup(s => s.GetService(typeof(IDesignerHost))) 1358mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(2)); 1369mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(3)); 1403Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 1413.Setup(s => s.GetService(typeof(IDesignerHost))) 1453mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(2)); 1466mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(3)); 1510Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 1520.Setup(s => s.GetService(typeof(IDesignerHost))) 1560mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(2)); 1573mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(3)); 1608Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 1618.Setup(s => s.GetService(typeof(IDesignerHost))) 1657mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(2)); 1667mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(3)); 1691Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 1697.Setup(s => s.GetService(typeof(IDesignerHost))) 1735mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(2)); 1742mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(3)); 1759.Setup(s => s.GetService(typeof(IDesignerHost))) 1793mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once()); 1798mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once()); 1815.Setup(s => s.GetService(typeof(IDesignerHost))) 1852mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once()); 1858mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once()); 1891.Setup(s => s.GetService(typeof(IDesignerHost))) 1929mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(2)); 1941mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(3)); 1961.Setup(s => s.GetService(typeof(IDesignerHost))) 2022Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 2028.Setup(s => s.GetService(typeof(IDesignerHost))) 2057mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once()); 2070Mock<IDesignerHost> mockNullDesignerHost = new(MockBehavior.Strict); 2076Mock<IDesignerHost> mockNonNullDesignerHost = new(MockBehavior.Strict); 2090.Setup(s => s.GetService(typeof(IDesignerHost))) 2120mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once()); 2141.Setup(s => s.GetService(typeof(IDesignerHost))) 2177mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once()); 2201.Setup(s => s.GetService(typeof(IDesignerHost))) 2235mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once()); 2613.Setup(s => s.GetService(typeof(IDesignerHost))) 2651.Setup(s => s.GetService(typeof(IDesignerHost)))
System\ComponentModel\Design\DesignerActionServiceTests.cs (10)
16Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 24.Setup(p => p.GetService(typeof(IDesignerHost))) 36mockServiceProvider.Verify(p => p.GetService(typeof(IDesignerHost)), Times.Once()); 252Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 261.Setup(p => p.GetService(typeof(IDesignerHost))) 283Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 292.Setup(p => p.GetService(typeof(IDesignerHost))) 315.Setup(p => p.GetService(typeof(IDesignerHost))) 316.Returns((IDesignerHost)null); 327.Setup(p => p.GetService(typeof(IDesignerHost)))
System\ComponentModel\Design\DesignerHostTests.cs (34)
2251IDesignerHost host = surface.Host; 2263IDesignerHost host = surface.Host; 2272IDesignerHost host = surface.Host; 2396IDesignerHost host = surface.Host; 2418IDesignerHost host = surface.Host; 2427IDesignerHost host = surface.Host; 2431private static readonly IDesignerHost s_placeholderHost = new Mock<IDesignerHost>(MockBehavior.Strict).Object; 2503IDesignerHost newDesigner = eventArgs.NewDesigner == s_placeholderHost ? host : eventArgs.NewDesigner; 2504IDesignerHost oldDesigner = eventArgs.OldDesigner == s_placeholderHost ? host : eventArgs.OldDesigner; 3068Assert.Equal(typeof(IDesignerHost), reflect.UnderlyingSystemType); 3076Assert.Equal(typeof(IDesignerHost).GetField(nameof(IDesignerHost.Activate)), reflect.GetField(nameof(IDesignerHost.Activate), BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public)); 3084Assert.Equal(typeof(IDesignerHost).GetFields(), reflect.GetFields(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public)); 3092Assert.Equal(typeof(IDesignerHost).GetMember(nameof(IDesignerHost.Container)), reflect.GetMember(nameof(IDesignerHost.Container), BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public)); 3100Assert.Equal(typeof(IDesignerHost).GetMembers(), reflect.GetMembers(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public)); 3108Assert.Equal(typeof(IDesignerHost).GetMethod(nameof(IDesignerHost.Activate)), reflect.GetMethod(nameof(IDesignerHost.Activate), BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public)); 3109Assert.Equal(typeof(IDesignerHost).GetMethod(nameof(IDesignerHost.Activate)), reflect.GetMethod(nameof(IDesignerHost.Activate), BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public, null, Array.Empty<Type>(), Array.Empty<ParameterModifier>())); 3117Assert.Equal(typeof(IDesignerHost).GetMethods(), reflect.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public)); 3125Assert.Equal(typeof(IDesignerHost).GetProperty(nameof(IDesignerHost.Container)), reflect.GetProperty(nameof(IDesignerHost.Container), BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public)); 3126Assert.Equal(typeof(IDesignerHost).GetProperty(nameof(IDesignerHost.Container)), reflect.GetProperty(nameof(IDesignerHost.Container), BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public, null, typeof(IContainer), Array.Empty<Type>(), Array.Empty<ParameterModifier>())); 3134Assert.Equal(typeof(IDesignerHost).GetProperties(), reflect.GetProperties(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public)); 3142Assert.Equal(surface.Host.Container, reflect.InvokeMember(nameof(IDesignerHost.Container), BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.GetProperty, null, surface.Host, Array.Empty<object>(), Array.Empty<ParameterModifier>(), null, Array.Empty<string>()));
System\ComponentModel\Design\DesignSurfaceTests.cs (1)
270yield return new object[] { typeof(IDesignerHost) };
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationServiceTests.cs (5)
97.Setup(p => p.GetService(typeof(IDesignerHost))) 194.Setup(p => p.GetService(typeof(IDesignerHost))) 233mockServiceProvider.Verify(p => p.GetService(typeof(IDesignerHost)), Times.Exactly(2)); 287.Setup(p => p.GetService(typeof(IDesignerHost))) 333mockServiceProvider.Verify(p => p.GetService(typeof(IDesignerHost)), Times.Exactly(2));
System\ComponentModel\Design\Serialization\DesignerSerializationManagerTests.cs (20)
31.Setup(p => p.GetService(typeof(IDesignerHost))) 32.Returns((IDesignerHost)null); 37.Setup(p => p.GetService(typeof(IDesignerHost))) 42Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 48.Setup(p => p.GetService(typeof(IDesignerHost))) 714.Setup(p => p.GetService(typeof(IDesignerHost))) 720Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 726.Setup(p => p.GetService(typeof(IDesignerHost))) 808Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 814.Setup(p => p.GetService(typeof(IDesignerHost))) 1080.Setup(p => p.GetService(typeof(IDesignerHost))) 1081.Returns((IDesignerHost)null); 1101.Setup(p => p.GetService(typeof(IDesignerHost))) 1102.Returns((IDesignerHost)null); 1448.Setup(p => p.GetService(typeof(IDesignerHost))) 1449.Returns((IDesignerHost)null); 1479.Setup(p => p.GetService(typeof(IDesignerHost))) 1480.Returns((IDesignerHost)null); 1576.Setup(p => p.GetService(typeof(IDesignerHost))) 1577.Returns((IDesignerHost)null);
System\ComponentModel\Design\UndoUnitTests.cs (2)
18Mock<IDesignerHost> mockDesignerHost = new(); 21.Setup(p => p.GetService(typeof(IDesignerHost)))
System\Drawing\Design\ToolboxComponentsCreatingEventArgsTests.cs (2)
14yield return new object[] { new Mock<IDesignerHost>(MockBehavior.Strict).Object }; 19public void Ctor_IDesignerHost(IDesignerHost host)
System\Drawing\Design\ToolboxItemTests.cs (18)
426Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 492Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 560Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 619Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 745Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 811Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 879Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 1189Mock<IDesignerHost> nullServiceDesignerHost = new(MockBehavior.Strict); 1254Mock<IDesignerHost> invalidServiceDesignerHost = new(MockBehavior.Strict); 1262Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 1278public void ToolboxItem_GetType_InvokeWithoutTypeNameAssemblyName_ReturnsExpected(IDesignerHost host, AssemblyName assemblyName, string typeName, bool reference, Type expected) 1295public void ToolboxItem_GetType_InvokeWithTypeNameAssemblyName_ReturnsExpected(IDesignerHost host, AssemblyName assemblyName, string typeName, bool reference, Type expected) 1305Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 1317Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 1641public new IComponent[] CreateComponentsCore(IDesignerHost host) 1646public new IComponent[] CreateComponentsCore(IDesignerHost host, IDictionary defaultValues) 1656public new Type GetType(IDesignerHost host, AssemblyName assemblyName, string typeName, bool reference) 1743protected override IComponent[] CreateComponentsCore(IDesignerHost host)
System\Windows\Forms\Design\ContextMenuStripActionListTests.cs (2)
14private readonly Mock<IDesignerHost> _mockDesignerHost; 38mockSite.Setup(s => s.GetService(typeof(IDesignerHost))).Returns(_mockDesignerHost.Object);
System\Windows\Forms\Design\DataGridViewColumnDesignerTests.cs (2)
20Mock<IDesignerHost> designerHostMock = new(); 26.Setup(s => s.GetService(typeof(IDesignerHost)))
System\Windows\Forms\Design\FlowPanelDesignerTests.cs (1)
17Mock<IDesignerHost> mockHost = new();
System\Windows\Forms\Design\SplitterPanelDesignerTests.cs (3)
23Mock<IDesignerHost> mockDesignerHost = new(); 27mockSite.Setup(s => s.GetService(typeof(IDesignerHost))).Returns(mockDesignerHost.Object); 52((IDesignerHost)splitterPanelDesigner.TestAccessor().Dynamic._designerHost).Should().Be(mockDesignerHost.Object);
System\Windows\Forms\Design\TabControlDesignerTests.cs (4)
14private (TabControlDesigner designer, TabControl tabControl) CreateInitializedDesignerWithServiceProvider(out Mock<IServiceProvider> serviceProvider, out Mock<IDesignerHost> designerHost) 20serviceProvider.Setup(s => s.GetService(typeof(IDesignerHost))).Returns(designerHost.Object); 31Mock<IDesignerHost> designerHost = new(); 32serviceProvider.Setup(s => s.GetService(typeof(IDesignerHost))).Returns(designerHost.Object);
System\Windows\Forms\Design\TextBoxBaseDesignerTests.cs (2)
23site.Setup(s => s.GetService(typeof(IDesignerHost))).Returns(new Mock<IDesignerHost>().Object);
System\Windows\Forms\Design\ToolStripContainerDesignerTests.cs (2)
15private readonly Mock<IDesignerHost> _mockDesignerHost; 33mockSite.Setup(s => s.GetService(typeof(IDesignerHost))).Returns(_mockDesignerHost.Object);
System\Windows\Forms\Design\UpDownBaseDesignerTests.cs (2)
23site.Setup(s => s.GetService(typeof(IDesignerHost))).Returns(new Mock<IDesignerHost>().Object);
TestControlDesigner.Mocks.cs (2)
15internal readonly Mock<IDesignerHost> _mockDesignerHost = new(); 48.Setup(s => s.GetService(typeof(IDesignerHost)))
ToolStripDesignerTests.cs (1)
21Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict);
ToolStripDropDownDesignerTest.cs (1)
19Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict);
ToolStripMenuItemDesignerTest.cs (2)
99Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 128Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict);
System.Windows.Forms.Primitives (2)
System\ServiceExtensions.cs (2)
52/// <param name="designerHost">The <see cref="IDesignerHost"/> to retrieve the service object from.</param> 58[NotNullWhen(true)] this IDesignerHost? designerHost,
System.Windows.Forms.Tests (52)
System\Windows\Forms\AxHostTests.cs (17)
262.Setup(s => s.GetService(typeof(IDesignerHost))) 602.Setup(s => s.GetService(typeof(IDesignerHost))) 635.Setup(s => s.GetService(typeof(IDesignerHost))) 666.Setup(s => s.GetService(typeof(IDesignerHost))) 697.Setup(s => s.GetService(typeof(IDesignerHost))) 730.Setup(s => s.GetService(typeof(IDesignerHost))) 761.Setup(s => s.GetService(typeof(IDesignerHost))) 796.Setup(s => s.GetService(typeof(IDesignerHost))) 844.Setup(s => s.GetService(typeof(IDesignerHost))) 1781.Setup(s => s.GetService(typeof(IDesignerHost))) 1834.Setup(s => s.GetService(typeof(IDesignerHost))) 1891.Setup(s => s.GetService(typeof(IDesignerHost))) 1946.Setup(s => s.GetService(typeof(IDesignerHost))) 2003.Setup(s => s.GetService(typeof(IDesignerHost))) 2065.Setup(s => s.GetService(typeof(IDesignerHost))) 2130.Setup(s => s.GetService(typeof(IDesignerHost))) 2204.Setup(s => s.GetService(typeof(IDesignerHost)))
System\Windows\Forms\ControlTests.Methods.cs (9)
2552Mock<IDesignerHost> mockNullDesignerHost = new(MockBehavior.Strict); 2558Mock<IDesignerHost> mockUnknownDesignerHost = new(MockBehavior.Strict); 2575.Setup(s => s.GetService(typeof(IDesignerHost))) 2589mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once()); 2594mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(2)); 2637Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 2643.Setup(s => s.GetService(typeof(IDesignerHost))) 2661mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once()); 2667mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(2));
System\Windows\Forms\Design\EventsTabTests.cs (4)
90Mock<IDesignerHost> nullMockDesignerHost = new(MockBehavior.Strict); 94Mock<IDesignerHost> invalidMockDesignerHost = new(MockBehavior.Strict); 104Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 141public IDesignerHost ActiveDesigner { get; set; }
System\Windows\Forms\ErrorProviderTests.cs (8)
651.Setup(s => s.GetService(typeof(IDesignerHost))) 657.Setup(s => s.GetService(typeof(IDesignerHost))) 668.Setup(s => s.GetService(typeof(IDesignerHost))) 692.Setup(s => s.GetService(typeof(IDesignerHost))) 725Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 731.Setup(s => s.GetService(typeof(IDesignerHost))) 738mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once()); 742mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once());
System\Windows\Forms\PropertyGridTests.cs (14)
2715Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 2733.Setup(s => s.GetService(typeof(IDesignerHost))) 2767var previousActiveDesigner = propertyGrid.ActiveDesigner; 2797.Setup(s => s.GetService(typeof(IDesignerHost))) 2798.Returns((IDesignerHost)null); 2815Mock<IDesignerHost> mockNullDesignerHost = new(MockBehavior.Strict); 2833.Setup(s => s.GetService(typeof(IDesignerHost))) 2839Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 2857.Setup(s => s.GetService(typeof(IDesignerHost))) 2919.Setup(s => s.GetService(typeof(IDesignerHost))) 2935Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 2953.Setup(s => s.GetService(typeof(IDesignerHost))) 2969Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 2987.Setup(s => s.GetService(typeof(IDesignerHost)))
System.Windows.Forms.UI.IntegrationTests (15)
DesignBehaviorsTests.cs (15)
62var designerHost = (IDesignerHost)designSurface.GetService(typeof(IDesignerHost))!; 142private readonly IDesignerHost _designerHost; 144public SampleToolboxService(IDesignerHost designerHost) 154public void AddCreator(ToolboxItemCreatorCallback creator, string format, IDesignerHost host) 159public void AddLinkedToolboxItem(ToolboxItem toolboxItem, IDesignerHost host) 164public void AddLinkedToolboxItem(ToolboxItem toolboxItem, string category, IDesignerHost host) 184public ToolboxItem DeserializeToolboxItem(object serializedObject, IDesignerHost? host) 195public ToolboxItem GetSelectedToolboxItem(IDesignerHost host) 205public ToolboxItemCollection GetToolboxItems(IDesignerHost host) 215public ToolboxItemCollection GetToolboxItems(string category, IDesignerHost host) 220public bool IsSupported(object serializedObject, IDesignerHost host) 235public bool IsToolboxItem(object serializedObject, IDesignerHost host) 250public void RemoveCreator(string format, IDesignerHost host)