1 interface inheriting from IDesignerHost
System.ComponentModel.TypeConverter (1)
System\ComponentModel\Design\Serialization\IDesignerLoaderHost.cs (1)
16public interface IDesignerLoaderHost : IDesignerHost
1062 references to IDesignerHost
DesignSurface (3)
CustomControls\CustomButtonDesignerActionList.cs (3)
8private readonly IDesignerHost _host; 16_host = GetService(typeof(IDesignerHost)) as IDesignerHost;
DesignSurfaceExt (11)
DesignSurfaceExt.cs (7)
90IDesignerHost host = GetIDesignerHost(); 111IDesignerHost ihost = GetIDesignerHost(); 160IComponent newComp = CreateComponent<TControl>(out IDesignerHost host); 196private TComponent CreateComponent<TComponent>(out IDesignerHost host) 225public IDesignerHost GetIDesignerHost() => (IDesignerHost)GetService(typeof(IDesignerHost));
IDesignSurfaceExt.cs (1)
31IDesignerHost GetIDesignerHost();
PropertyGridExt.cs (2)
8private IDesignerHost _host; 37public IDesignerHost DesignerHost
TabOrderHooker.cs (1)
14public 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)
1990if (Site.TryGetService(out IDesignerHost? host) && host.RootComponent is ContainerControl rootControl) 3019Site.TryGetService(out IDesignerHost? host);
System\Windows\Forms\Control.cs (1)
5288&& site.TryGetService(out IDesignerHost? host)
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (9)
62private IDesignerHost? _designerHost; 243internal IDesignerHost? ActiveDesigner 245get => _designerHost ??= GetService<IDesignerHost>(); 1157ActiveDesigner = value?.GetService<IDesignerHost>(); 1477IDesignerHost? host = null; 1480host = site.GetService<IDesignerHost>(); 1635private PropertyTab? CreateTab(Type tabType, IDesignerHost? host) 1656constructor = tabType.GetConstructor([typeof(IDesignerHost)]); 1762if (_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)
235/// The currently active <see cref="IDesignerHost"/>, if any. 243internal virtual IDesignerHost? DesignerHost 884IDesignerHost? 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 (624)
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)]; 712DesignerTransaction t = ((IDesignerHost)this).CreateTransaction(); 847if (!((IDesignerHost)this).Loading) 857if (!((IDesignerHost)this).Loading) 863bool IDesignerHost.Loading => 866bool IDesignerHost.InTransaction => (_transactions is not null && _transactions.Count > 0) || IsClosingTransaction; 868IContainer IDesignerHost.Container => this; 870IComponent IDesignerHost.RootComponent => _rootComponent!; 872string IDesignerHost.RootComponentClassName => _rootComponentClassName!; 874string IDesignerHost.TransactionDescription => 879event EventHandler IDesignerHost.Activated 885event EventHandler IDesignerHost.Deactivated 891event EventHandler IDesignerHost.LoadComplete 897event DesignerTransactionCloseEventHandler IDesignerHost.TransactionClosed 903event DesignerTransactionCloseEventHandler IDesignerHost.TransactionClosing 909event EventHandler IDesignerHost.TransactionOpened 915event EventHandler IDesignerHost.TransactionOpening 921void IDesignerHost.Activate() => _surface?.OnViewActivate(); 925IComponent IDesignerHost.CreateComponent(Type componentType) => 926((IDesignerHost)this).CreateComponent(componentType, null!); 928IComponent IDesignerHost.CreateComponent(Type componentType, string name) 988DesignerTransaction IDesignerHost.CreateTransaction() => 989((IDesignerHost)this).CreateTransaction(SR.DesignerHostGenericTransactionName); 991DesignerTransaction IDesignerHost.CreateTransaction(string description) => 994void IDesignerHost.DestroyComponent(IComponent component) 1009if (((IDesignerHost)this).InTransaction) 1017using (t = ((IDesignerHost)this).CreateTransaction(string.Format(SR.DesignerHostDestroyComponentTransaction, name))) 1029IDesigner? IDesignerHost.GetDesigner(IComponent component) 1036Type? IDesignerHost.GetType(string typeName) 1097IRootDesigner rootDesigner = (((IDesignerHost)this).GetDesigner(_rootComponent!) as IRootDesigner) 1205typeof(IDesignerHost).GetMethod(name, bindingAttr, binder, types, modifiers); 1208MethodInfo? IReflect.GetMethod(string name, BindingFlags bindingAttr) => typeof(IDesignerHost).GetMethod(name, bindingAttr); 1211MethodInfo[] IReflect.GetMethods(BindingFlags bindingAttr) => typeof(IDesignerHost).GetMethods(bindingAttr); 1214FieldInfo? IReflect.GetField(string name, BindingFlags bindingAttr) => typeof(IDesignerHost).GetField(name, bindingAttr); 1217FieldInfo[] IReflect.GetFields(BindingFlags bindingAttr) => typeof(IDesignerHost).GetFields(bindingAttr); 1220PropertyInfo? IReflect.GetProperty(string name, BindingFlags bindingAttr) => typeof(IDesignerHost).GetProperty(name, bindingAttr); 1224typeof(IDesignerHost).GetProperty(name, bindingAttr, binder, returnType, types, modifiers); 1227PropertyInfo[] IReflect.GetProperties(BindingFlags bindingAttr) => typeof(IDesignerHost).GetProperties(bindingAttr); 1243MemberInfo[] IReflect.GetMember(string name, BindingFlags bindingAttr) => typeof(IDesignerHost).GetMember(name, bindingAttr); 1246MemberInfo[] IReflect.GetMembers(BindingFlags bindingAttr) => typeof(IDesignerHost).GetMembers(bindingAttr); 1258typeof(IDesignerHost).InvokeMember(name, invokeAttr, binder, target, args, modifiers, culture, namedParameters); 1260Type 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) 786IDesignerHost? host = _serviceProvider.GetService<IDesignerHost>();
System\Windows\Forms\Design\Behavior\ContainerSelectorBehavior.cs (1)
209|| !_serviceProvider.TryGetService(out IDesignerHost? host))
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 (1)
340if (_serviceProvider.TryGetService(out IDesignerHost? host))
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; 946_host = GetService<IDesignerHost>(); 1164&& TryGetService(out IDesignerHost? host)) 1688_host ??= GetService<IDesignerHost>(); 1911if (_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\DataGridViewColumnCollectionEditor.cs (1)
20!provider.TryGetService(out IDesignerHost? host))
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) 160private Type? GetAxTypeFromReference(object reference, IDesignerHost host) 215private static object? GetReferences(IDesignerHost host)
System\Windows\Forms\Design\DocumentDesigner.cs (28)
112IDesignerHost host = GetService(typeof(IDesignerHost)) as IDesignerHost; 254IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 329IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 613IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 670IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 828if (GetService(typeof(IDesignerHost)) is IDesignerHost host) 867if (!TryGetService(out IDesignerHost host)) 941IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 977IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 1092((IDesignerHost)sender).LoadComplete -= OnLoadComplete; 1364IDesignerHost 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)
71protected override IComponent[]? CreateComponentsCore(IDesignerHost? host, IDictionary? defaultValues) 143protected 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)
306IDesignerHost? 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>(); 1058var host = _tableLayoutPanel.Site.GetService<IDesignerHost>();
System\Windows\Forms\Design\TabControlDesigner.cs (12)
126IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 237IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 332IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); 483IDesignerHost 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\ToolStripCollectionEditor.cs (2)
56IDesignerHost? host = provider.GetService<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 1421_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)); 544IDesignerHost designerHost = (IDesignerHost)glyphItem.Site.GetService(typeof(IDesignerHost)); 648IDesignerHost designerHost = (IDesignerHost)currentDropItem.Site.GetService(typeof(IDesignerHost)); 907IDesignerHost designerHost = (IDesignerHost)item.Site.GetService(typeof(IDesignerHost)); 965IDesignerHost 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; 905IDesignerHost host = Host; 1663IDesignerHost host = Host; 1754IDesignerHost host = Host;
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (5)
32private IDesignerHost _designerHost; 1519_designerHost = GetService<IDesignerHost>(); 2679IDesignerHost 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 (294)
Mocks\MockSite.cs (1)
18.Setup(s => s.GetService(typeof(IDesignerHost)))
SplitContainerDesignerTests.cs (1)
17Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict);
System\ComponentModel\Design\CollectionEditorTests.cs (22)
145.Setup(c => c.GetService(typeof(IDesignerHost))) 187Mock<IDesignerHost> mockHost = new(MockBehavior.Strict); 203.Setup(c => c.GetService(typeof(IDesignerHost))) 234Mock<IDesignerHost> mockHost = new(MockBehavior.Strict); 254.Setup(c => c.GetService(typeof(IDesignerHost))) 291Mock<IDesignerHost> mockHost = new(MockBehavior.Strict); 307.Setup(c => c.GetService(typeof(IDesignerHost))) 394.Setup(c => c.GetService(typeof(IDesignerHost))) 434Mock<IDesignerHost> mockHost = new(MockBehavior.Strict); 447.Setup(c => c.GetService(typeof(IDesignerHost))) 508.Setup(c => c.GetService(typeof(IDesignerHost))) 539Mock<IDesignerHost> mockHost = new(MockBehavior.Strict); 549.Setup(c => c.GetService(typeof(IDesignerHost))) 585Mock<IDesignerHost> mockHost = new(MockBehavior.Strict); 595.Setup(c => c.GetService(typeof(IDesignerHost))) 632Mock<IDesignerHost> mockHost = new(MockBehavior.Strict); 642.Setup(c => c.GetService(typeof(IDesignerHost))) 675Mock<IDesignerHost> mockHost = new(MockBehavior.Strict); 685.Setup(c => c.GetService(typeof(IDesignerHost))) 796.Setup(c => c.GetService(typeof(IDesignerHost))) 903.Setup(c => c.GetService(typeof(IDesignerHost))) 941.Setup(c => c.GetService(typeof(IDesignerHost)))
System\ComponentModel\Design\CollectionFormTests.cs (15)
122.Setup(c => c.GetService(typeof(IDesignerHost))) 178.Setup(c => c.GetService(typeof(IDesignerHost))) 237.Setup(c => c.GetService(typeof(IDesignerHost))) 296.Setup(c => c.GetService(typeof(IDesignerHost))) 355.Setup(c => c.GetService(typeof(IDesignerHost))) 409.Setup(c => c.GetService(typeof(IDesignerHost))) 515.Setup(c => c.GetService(typeof(IDesignerHost))) 558Mock<IDesignerHost> mockHost = new(MockBehavior.Strict); 574.Setup(c => c.GetService(typeof(IDesignerHost))) 606Mock<IDesignerHost> mockHost = new(MockBehavior.Strict); 626.Setup(c => c.GetService(typeof(IDesignerHost))) 664Mock<IDesignerHost> mockHost = new(MockBehavior.Strict); 680.Setup(c => c.GetService(typeof(IDesignerHost))) 736.Setup(c => c.GetService(typeof(IDesignerHost))) 775.Setup(c => c.GetService(typeof(IDesignerHost)))
System\ComponentModel\Design\ComponentDesignerTests.cs (98)
48var service = designer.GetService<IDesignerHost>(); 54service = designer.GetService<IDesignerHost>(); 57Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 65service = designer.GetService<IDesignerHost>(); 84Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 107Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 145Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 209.Setup(s => s.GetService(typeof(IDesignerHost))) 310Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 322mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once()); 326mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(2)); 331mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(3)); 340Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 347mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once()); 351mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(2)); 356mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(3)); 379mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once()); 382mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(2)); 386mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(3)); 395Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 411mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once()); 416mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(rootComponent is null ? 2 : 3)); 422mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(rootComponent is null ? 3 : 5)); 433Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 440mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once()); 444mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(2)); 449mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(3)); 467mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once()); 470mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(2)); 474mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(3)); 483Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 490.Setup(s => s.GetService(typeof(IDesignerHost))) 529mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once()); 532mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(3)); 536mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(4)); 574.Setup(s => s.GetService(typeof(IDesignerHost))) 795Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 805.Setup(s => s.GetService(typeof(IDesignerHost))) 910Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 920.Setup(s => s.GetService(typeof(IDesignerHost))) 958mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(2)); 971mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(3)); 1019Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 1029.Setup(s => s.GetService(typeof(IDesignerHost))) 1071mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(2)); 1095mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(3)); 1127Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 1137.Setup(s => s.GetService(typeof(IDesignerHost))) 1177mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(2)); 1188mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(3)); 1220Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 1230.Setup(s => s.GetService(typeof(IDesignerHost))) 1270mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(2)); 1281mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(3)); 1311Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 1321.Setup(s => s.GetService(typeof(IDesignerHost))) 1360mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(2)); 1371mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(3)); 1405Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 1415.Setup(s => s.GetService(typeof(IDesignerHost))) 1455mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(2)); 1468mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(3)); 1512Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 1522.Setup(s => s.GetService(typeof(IDesignerHost))) 1562mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(2)); 1575mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(3)); 1610Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 1620.Setup(s => s.GetService(typeof(IDesignerHost))) 1659mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(2)); 1669mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(3)); 1693Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 1699.Setup(s => s.GetService(typeof(IDesignerHost))) 1737mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(2)); 1744mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(3)); 1761.Setup(s => s.GetService(typeof(IDesignerHost))) 1795mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once()); 1800mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once()); 1817.Setup(s => s.GetService(typeof(IDesignerHost))) 1854mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once()); 1860mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once()); 1893.Setup(s => s.GetService(typeof(IDesignerHost))) 1931mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(2)); 1943mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(3)); 1963.Setup(s => s.GetService(typeof(IDesignerHost))) 2024Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 2030.Setup(s => s.GetService(typeof(IDesignerHost))) 2059mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once()); 2072Mock<IDesignerHost> mockNullDesignerHost = new(MockBehavior.Strict); 2078Mock<IDesignerHost> mockNonNullDesignerHost = new(MockBehavior.Strict); 2092.Setup(s => s.GetService(typeof(IDesignerHost))) 2122mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once()); 2143.Setup(s => s.GetService(typeof(IDesignerHost))) 2179mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once()); 2203.Setup(s => s.GetService(typeof(IDesignerHost))) 2237mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once()); 2615.Setup(s => s.GetService(typeof(IDesignerHost))) 2653.Setup(s => s.GetService(typeof(IDesignerHost)))
System\ComponentModel\Design\DesignerActionServiceTests.cs (10)
18Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 26.Setup(p => p.GetService(typeof(IDesignerHost))) 38mockServiceProvider.Verify(p => p.GetService(typeof(IDesignerHost)), Times.Once()); 254Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 263.Setup(p => p.GetService(typeof(IDesignerHost))) 285Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 294.Setup(p => p.GetService(typeof(IDesignerHost))) 317.Setup(p => p.GetService(typeof(IDesignerHost))) 318.Returns((IDesignerHost)null); 329.Setup(p => p.GetService(typeof(IDesignerHost)))
System\ComponentModel\Design\DesignerHostTests.cs (34)
2253IDesignerHost host = surface.Host; 2265IDesignerHost host = surface.Host; 2274IDesignerHost host = surface.Host; 2398IDesignerHost host = surface.Host; 2420IDesignerHost host = surface.Host; 2429IDesignerHost host = surface.Host; 2433private static readonly IDesignerHost s_placeholderHost = new Mock<IDesignerHost>(MockBehavior.Strict).Object; 2505IDesignerHost newDesigner = eventArgs.NewDesigner == s_placeholderHost ? host : eventArgs.NewDesigner; 2506IDesignerHost oldDesigner = eventArgs.OldDesigner == s_placeholderHost ? host : eventArgs.OldDesigner; 3070Assert.Equal(typeof(IDesignerHost), reflect.UnderlyingSystemType); 3078Assert.Equal(typeof(IDesignerHost).GetField(nameof(IDesignerHost.Activate)), reflect.GetField(nameof(IDesignerHost.Activate), BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public)); 3086Assert.Equal(typeof(IDesignerHost).GetFields(), reflect.GetFields(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public)); 3094Assert.Equal(typeof(IDesignerHost).GetMember(nameof(IDesignerHost.Container)), reflect.GetMember(nameof(IDesignerHost.Container), BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public)); 3102Assert.Equal(typeof(IDesignerHost).GetMembers(), reflect.GetMembers(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public)); 3110Assert.Equal(typeof(IDesignerHost).GetMethod(nameof(IDesignerHost.Activate)), reflect.GetMethod(nameof(IDesignerHost.Activate), BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public)); 3111Assert.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>())); 3119Assert.Equal(typeof(IDesignerHost).GetMethods(), reflect.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public)); 3127Assert.Equal(typeof(IDesignerHost).GetProperty(nameof(IDesignerHost.Container)), reflect.GetProperty(nameof(IDesignerHost.Container), BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public)); 3128Assert.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>())); 3136Assert.Equal(typeof(IDesignerHost).GetProperties(), reflect.GetProperties(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public)); 3144Assert.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)
272yield return new object[] { typeof(IDesignerHost) };
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationServiceTests.cs (5)
101.Setup(p => p.GetService(typeof(IDesignerHost))) 198.Setup(p => p.GetService(typeof(IDesignerHost))) 237mockServiceProvider.Verify(p => p.GetService(typeof(IDesignerHost)), Times.Exactly(2)); 291.Setup(p => p.GetService(typeof(IDesignerHost))) 337mockServiceProvider.Verify(p => p.GetService(typeof(IDesignerHost)), Times.Exactly(2));
System\ComponentModel\Design\Serialization\DesignerSerializationManagerTests.cs (20)
33.Setup(p => p.GetService(typeof(IDesignerHost))) 34.Returns((IDesignerHost)null); 39.Setup(p => p.GetService(typeof(IDesignerHost))) 44Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 50.Setup(p => p.GetService(typeof(IDesignerHost))) 716.Setup(p => p.GetService(typeof(IDesignerHost))) 722Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 728.Setup(p => p.GetService(typeof(IDesignerHost))) 810Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 816.Setup(p => p.GetService(typeof(IDesignerHost))) 1082.Setup(p => p.GetService(typeof(IDesignerHost))) 1083.Returns((IDesignerHost)null); 1103.Setup(p => p.GetService(typeof(IDesignerHost))) 1104.Returns((IDesignerHost)null); 1450.Setup(p => p.GetService(typeof(IDesignerHost))) 1451.Returns((IDesignerHost)null); 1481.Setup(p => p.GetService(typeof(IDesignerHost))) 1482.Returns((IDesignerHost)null); 1578.Setup(p => p.GetService(typeof(IDesignerHost))) 1579.Returns((IDesignerHost)null);
System\ComponentModel\Design\UndoUnitTests.cs (2)
20Mock<IDesignerHost> mockDesignerHost = new(); 23.Setup(p => p.GetService(typeof(IDesignerHost)))
System\Drawing\Design\ToolboxComponentsCreatingEventArgsTests.cs (2)
16yield return new object[] { new Mock<IDesignerHost>(MockBehavior.Strict).Object }; 21public void Ctor_IDesignerHost(IDesignerHost host)
System\Drawing\Design\ToolboxItemTests.cs (18)
428Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 494Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 562Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 621Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 747Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 813Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 881Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 1191Mock<IDesignerHost> nullServiceDesignerHost = new(MockBehavior.Strict); 1256Mock<IDesignerHost> invalidServiceDesignerHost = new(MockBehavior.Strict); 1264Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 1280public void ToolboxItem_GetType_InvokeWithoutTypeNameAssemblyName_ReturnsExpected(IDesignerHost host, AssemblyName assemblyName, string typeName, bool reference, Type expected) 1297public void ToolboxItem_GetType_InvokeWithTypeNameAssemblyName_ReturnsExpected(IDesignerHost host, AssemblyName assemblyName, string typeName, bool reference, Type expected) 1307Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 1319Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 1643public new IComponent[] CreateComponentsCore(IDesignerHost host) 1648public new IComponent[] CreateComponentsCore(IDesignerHost host, IDictionary defaultValues) 1658public new Type GetType(IDesignerHost host, AssemblyName assemblyName, string typeName, bool reference) 1745protected override IComponent[] CreateComponentsCore(IDesignerHost host)
System\Windows\Forms\Design\CommandSetTests.cs (2)
17Mock<IDesignerHost> mockDesignerHost = new(); 23mockSite.Setup(s => s.GetService(typeof(IDesignerHost))).Returns(mockDesignerHost.Object);
System\Windows\Forms\Design\ContextMenuStripActionListTests.cs (2)
12private readonly Mock<IDesignerHost> _mockDesignerHost; 36mockSite.Setup(s => s.GetService(typeof(IDesignerHost))).Returns(_mockDesignerHost.Object);
System\Windows\Forms\Design\ControlCodeDomSerializerTests.cs (2)
15private readonly Mock<IDesignerHost> _hostMock; 30_managerMock.Setup(m => m.GetService(typeof(IDesignerHost))).Returns(_hostMock.Object);
System\Windows\Forms\Design\ControlCommandSetTests.cs (2)
14private readonly Mock<IDesignerHost> _designerHostMock; 32_siteMock.Setup(s => s.GetService(typeof(IDesignerHost))).Returns(_designerHostMock.Object);
System\Windows\Forms\Design\DataGridViewColumnDesignerTests.cs (2)
18Mock<IDesignerHost> designerHostMock = new(); 24.Setup(s => s.GetService(typeof(IDesignerHost)))
System\Windows\Forms\Design\DataGridViewColumnTypeEditorTests.cs (2)
65Mock<IDesignerHost> mockDesignerHost = new(); 70mockProvider.Setup(p => p.GetService(typeof(IDesignerHost)))
System\Windows\Forms\Design\FlowLayoutPanelDesignerTests.cs (2)
15private readonly Mock<IDesignerHost> _designerHostMock; 26_serviceProviderMock.Setup(s => s.GetService(typeof(IDesignerHost))).Returns(_designerHostMock.Object);
System\Windows\Forms\Design\FlowPanelDesignerTests.cs (1)
15Mock<IDesignerHost> mockHost = new();
System\Windows\Forms\Design\OleDragDropHandlerTests.cs (2)
67_serviceProviderMock.Setup(sp => sp.GetService(typeof(IDesignerHost))).Returns((IDesignerHost?)null);
System\Windows\Forms\Design\ParentControlDesignerTests.cs (4)
71Mock<IDesignerHost> mockDesignerHost = new(); 74mockSite.Setup(s => s.GetService(typeof(IDesignerHost))).Returns(mockDesignerHost.Object); 103Mock<IDesignerHost> mockDesignerHost = new(); 111mockSite.Setup(s => s.GetService(typeof(IDesignerHost))).Returns(mockDesignerHost.Object);
System\Windows\Forms\Design\SelectionUIHandlerTests.cs (2)
17private readonly Mock<IDesignerHost> _designerHostMock; 33_selectionUIHandlerMock.Protected().Setup<object>("GetService", typeof(IDesignerHost)).Returns(_designerHostMock.Object);
System\Windows\Forms\Design\SplitterPanelDesignerTests.cs (3)
21Mock<IDesignerHost> mockDesignerHost = new(); 25mockSite.Setup(s => s.GetService(typeof(IDesignerHost))).Returns(mockDesignerHost.Object); 50((IDesignerHost)splitterPanelDesigner.TestAccessor().Dynamic._designerHost).Should().Be(mockDesignerHost.Object);
System\Windows\Forms\Design\TabControlDesignerTests.cs (4)
12private (TabControlDesigner designer, TabControl tabControl) CreateInitializedDesignerWithServiceProvider(out Mock<IServiceProvider> serviceProvider, out Mock<IDesignerHost> designerHost) 18serviceProvider.Setup(s => s.GetService(typeof(IDesignerHost))).Returns(designerHost.Object); 29Mock<IDesignerHost> designerHost = new(); 30serviceProvider.Setup(s => s.GetService(typeof(IDesignerHost))).Returns(designerHost.Object);
System\Windows\Forms\Design\TableLayoutPanelDesignerTests.cs (3)
116Mock<IDesignerHost> hostMock = new(); 124serviceProviderMock.Setup(sp => sp.GetService(typeof(IDesignerHost))) 132if (serviceType == typeof(IDesignerHost))
System\Windows\Forms\Design\TabOrderTests.cs (1)
14private readonly Mock<IDesignerHost> _mockHost;
System\Windows\Forms\Design\TextBoxBaseDesignerTests.cs (2)
21site.Setup(s => s.GetService(typeof(IDesignerHost))).Returns(new Mock<IDesignerHost>().Object);
System\Windows\Forms\Design\ToolStripActionListTests.cs (2)
12private readonly Mock<IDesignerHost> _mockDesignerHost; 34mockSite.Setup(s => s.GetService(typeof(IDesignerHost))).Returns(_mockDesignerHost.Object);
System\Windows\Forms\Design\ToolStripContainerActionListTests.cs (2)
13private readonly Mock<IDesignerHost> _designerHostMock; 22_siteMock.Setup(s => s.GetService(typeof(IDesignerHost))).Returns(_designerHostMock.Object);
System\Windows\Forms\Design\ToolStripContainerDesignerTests.cs (2)
13private readonly Mock<IDesignerHost> _mockDesignerHost; 31mockSite.Setup(s => s.GetService(typeof(IDesignerHost))).Returns(_mockDesignerHost.Object);
System\Windows\Forms\Design\ToolStripEditorManagerTests.cs (5)
17private readonly Mock<IDesignerHost> _mockDesignerHost; 42_mockSite.Setup(s => s.GetService(typeof(IDesignerHost))).Returns(_mockDesignerHost.Object); 72IDesignerHost? designerHost = _editorManager.TestAccessor().Dynamic._designerHost; 127Mock<IDesignerHost> mockDesignerHost = new(); 130mockSite.Setup(s => s.GetService(typeof(IDesignerHost))).Returns(mockDesignerHost.Object);
System\Windows\Forms\Design\ToolStripInSituServiceTests.cs (3)
13private readonly Mock<IDesignerHost> _mockDesignerHost; 32_mockServiceProvider.Setup(sp => sp.GetService(typeof(IDesignerHost))).Returns(_mockDesignerHost.Object); 150_mockServiceProvider.Setup(sp => sp.GetService(typeof(IDesignerHost))).Returns(null!);
System\Windows\Forms\Design\ToolStripPanelDesignerTests.cs (5)
15private readonly Mock<IDesignerHost> _mockDesignerHost = new(); 34_mockSite.Setup(s => s.GetService(typeof(IDesignerHost))).Returns(_mockDesignerHost.Object); 56_mockSite.Setup(s => s.GetService(typeof(IDesignerHost))).Returns(_mockDesignerHost.Object); 110Mock<IDesignerHost> mockDesignerHost = new(); 112_mockSite.Setup(s => s.GetService(typeof(IDesignerHost))).Returns(mockDesignerHost.Object);
System\Windows\Forms\Design\UpDownBaseDesignerTests.cs (2)
21site.Setup(s => s.GetService(typeof(IDesignerHost))).Returns(new Mock<IDesignerHost>().Object);
System\Windows\Forms\Design\UserControlDocumentDesignerTests.cs (2)
21Mock<IDesignerHost> designerHost = new(); 31.Setup(s => s.GetService(typeof(IDesignerHost)))
TestControlDesigner.Mocks.cs (2)
13internal readonly Mock<IDesignerHost> _mockDesignerHost = new(); 46.Setup(s => s.GetService(typeof(IDesignerHost)))
ToolStripDesignerTests.cs (1)
23Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict);
ToolStripDropDownDesignerTest.cs (1)
21Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict);
ToolStripMenuItemDesignerTest.cs (2)
101Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 130Mock<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)
264.Setup(s => s.GetService(typeof(IDesignerHost))) 604.Setup(s => s.GetService(typeof(IDesignerHost))) 637.Setup(s => s.GetService(typeof(IDesignerHost))) 668.Setup(s => s.GetService(typeof(IDesignerHost))) 699.Setup(s => s.GetService(typeof(IDesignerHost))) 732.Setup(s => s.GetService(typeof(IDesignerHost))) 763.Setup(s => s.GetService(typeof(IDesignerHost))) 798.Setup(s => s.GetService(typeof(IDesignerHost))) 846.Setup(s => s.GetService(typeof(IDesignerHost))) 1783.Setup(s => s.GetService(typeof(IDesignerHost))) 1836.Setup(s => s.GetService(typeof(IDesignerHost))) 1893.Setup(s => s.GetService(typeof(IDesignerHost))) 1948.Setup(s => s.GetService(typeof(IDesignerHost))) 2005.Setup(s => s.GetService(typeof(IDesignerHost))) 2067.Setup(s => s.GetService(typeof(IDesignerHost))) 2132.Setup(s => s.GetService(typeof(IDesignerHost))) 2206.Setup(s => s.GetService(typeof(IDesignerHost)))
System\Windows\Forms\ControlTests.Methods.cs (9)
2521Mock<IDesignerHost> mockNullDesignerHost = new(MockBehavior.Strict); 2527Mock<IDesignerHost> mockUnknownDesignerHost = new(MockBehavior.Strict); 2544.Setup(s => s.GetService(typeof(IDesignerHost))) 2558mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once()); 2563mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(2)); 2606Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 2612.Setup(s => s.GetService(typeof(IDesignerHost))) 2630mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once()); 2636mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Exactly(2));
System\Windows\Forms\Design\EventsTabTests.cs (4)
92Mock<IDesignerHost> nullMockDesignerHost = new(MockBehavior.Strict); 96Mock<IDesignerHost> invalidMockDesignerHost = new(MockBehavior.Strict); 106Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 143public IDesignerHost ActiveDesigner { get; set; }
System\Windows\Forms\ErrorProviderTests.cs (8)
653.Setup(s => s.GetService(typeof(IDesignerHost))) 659.Setup(s => s.GetService(typeof(IDesignerHost))) 670.Setup(s => s.GetService(typeof(IDesignerHost))) 694.Setup(s => s.GetService(typeof(IDesignerHost))) 727Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 733.Setup(s => s.GetService(typeof(IDesignerHost))) 740mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once()); 744mockSite.Verify(s => s.GetService(typeof(IDesignerHost)), Times.Once());
System\Windows\Forms\PropertyGridTests.cs (14)
2717Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 2735.Setup(s => s.GetService(typeof(IDesignerHost))) 2769var previousActiveDesigner = propertyGrid.ActiveDesigner; 2799.Setup(s => s.GetService(typeof(IDesignerHost))) 2800.Returns((IDesignerHost)null); 2817Mock<IDesignerHost> mockNullDesignerHost = new(MockBehavior.Strict); 2835.Setup(s => s.GetService(typeof(IDesignerHost))) 2841Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 2859.Setup(s => s.GetService(typeof(IDesignerHost))) 2921.Setup(s => s.GetService(typeof(IDesignerHost))) 2937Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 2955.Setup(s => s.GetService(typeof(IDesignerHost))) 2971Mock<IDesignerHost> mockDesignerHost = new(MockBehavior.Strict); 2989.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) 197public ToolboxItem GetSelectedToolboxItem(IDesignerHost host) 207public ToolboxItemCollection GetToolboxItems(IDesignerHost host) 217public ToolboxItemCollection GetToolboxItems(string category, IDesignerHost host) 222public bool IsSupported(object serializedObject, IDesignerHost host) 237public bool IsToolboxItem(object serializedObject, IDesignerHost host) 252public void RemoveCreator(string format, IDesignerHost host)