1 interface inheriting from IServiceContainer
System.ComponentModel.TypeConverter (1)
System\ComponentModel\Design\IDesignerHost.cs (1)
12public interface IDesignerHost : IServiceContainer
2 implementations of IServiceContainer
System.ComponentModel.TypeConverter (1)
System\ComponentModel\Design\ServiceContainer.cs (1)
12public class ServiceContainer : IServiceContainer, IDisposable
System.Windows.Forms.Design (1)
System\ComponentModel\Design\DesignerHost.Site.cs (1)
13internal class Site : ISite, IServiceContainer, IDictionaryService
102 references to IServiceContainer
DesignSurfaceExt (12)
DesignSurfaceExt.cs (12)
33IServiceContainer serviceProvider = GetService(typeof(IServiceContainer)) as IServiceContainer; 46IServiceContainer serviceProvider = GetService(typeof(IServiceContainer)) as IServiceContainer; 59IServiceContainer serviceProvider = GetService(typeof(IServiceContainer)) as IServiceContainer; 72IServiceContainer serviceProvider = GetService(typeof(IServiceContainer)) as IServiceContainer;
netstandard (1)
netstandard.cs (1)
269[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.ComponentModel.Design.IServiceContainer))]
System (1)
src\libraries\shims\System\ref\System.cs (1)
255[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.ComponentModel.Design.IServiceContainer))]
System.ComponentModel.TypeConverter (8)
System\ComponentModel\Design\ServiceContainer.cs (7)
16private static readonly Type[] s_defaultServices = new Type[] { typeof(IServiceContainer), typeof(ServiceContainer) }; 36private IServiceContainer? Container 38get => _parentProvider?.GetService(typeof(IServiceContainer)) as IServiceContainer; 70IServiceContainer? container = Container; 111IServiceContainer? container = Container; 227IServiceContainer? container = Container;
System\ComponentModel\Design\ServiceCreatorCallback.cs (1)
9public delegate object? ServiceCreatorCallback(IServiceContainer container, Type serviceType);
System.Windows.Forms.Design (47)
System\ComponentModel\Design\ComponentDesigner.cs (1)
385if (component.Site is IServiceContainer sc && GetService(typeof(DesignerCommandSet)) is null)
System\ComponentModel\Design\DesignerActionService.cs (3)
175IServiceContainer? serviceContainer = component.Site as IServiceContainer; 244if (_selectionService?.PrimarySelection is IComponent { Site: IServiceContainer container } comp)
System\ComponentModel\Design\DesignerHost.cs (20)
87if (this.TryGetService(out IServiceContainer? sc)) 463if (this.TryGetService(out IServiceContainer? sc)) 1265void IServiceContainer.AddService(Type serviceType, object serviceInstance) 1267ObjectDisposedException.ThrowIf(!this.TryGetService(out IServiceContainer? sc), typeof(IServiceContainer)); 1271void IServiceContainer.AddService(Type serviceType, object serviceInstance, bool promote) 1273ObjectDisposedException.ThrowIf(!this.TryGetService(out IServiceContainer? sc), typeof(IServiceContainer)); 1277void IServiceContainer.AddService(Type serviceType, ServiceCreatorCallback callback) 1279ObjectDisposedException.ThrowIf(!this.TryGetService(out IServiceContainer? sc), typeof(IServiceContainer)); 1283void IServiceContainer.AddService(Type serviceType, ServiceCreatorCallback callback, bool promote) 1285ObjectDisposedException.ThrowIf(!this.TryGetService(out IServiceContainer? sc), typeof(IServiceContainer)); 1289void IServiceContainer.RemoveService(Type serviceType) 1291ObjectDisposedException.ThrowIf(!this.TryGetService(out IServiceContainer? sc), typeof(IServiceContainer)); 1295void IServiceContainer.RemoveService(Type serviceType, bool promote) 1297ObjectDisposedException.ThrowIf(!this.TryGetService(out IServiceContainer? sc), typeof(IServiceContainer));
System\ComponentModel\Design\DesignerHost.Site.cs (12)
34private IServiceContainer SiteServiceContainer 40IServiceContainer? sc = (nc.GetServiceInternal(typeof(IServiceContainer)) as IServiceContainer); 100void IServiceContainer.AddService(Type serviceType, object serviceInstance) 108void IServiceContainer.AddService(Type serviceType, object serviceInstance, bool promote) 116void IServiceContainer.AddService(Type serviceType, ServiceCreatorCallback callback) 124void IServiceContainer.AddService(Type serviceType, ServiceCreatorCallback callback, bool promote) 132void IServiceContainer.RemoveService(Type serviceType) 140void IServiceContainer.RemoveService(Type serviceType, bool promote) 167_ = _nestedContainer.GetServiceInternal(typeof(IServiceContainer)); 176if (service != typeof(IServiceContainer) && service != typeof(IContainer) && _nestedContainer is not null)
System\ComponentModel\Design\DesignSurface.cs (1)
407private object OnCreateService(IServiceContainer container, Type serviceType)
System\ComponentModel\Design\DesignSurfaceManager.cs (1)
317private static object? OnCreateService(IServiceContainer container, Type serviceType)
System\ComponentModel\Design\Serialization\BasicDesignerLoader.cs (2)
179IServiceContainer sc = GetRequiredService<IServiceContainer>();
System\ComponentModel\Design\Serialization\CodeDomDesignerLoader.cs (1)
738private object? OnCreateService(IServiceContainer container, Type serviceType)
System\ComponentModel\Design\Serialization\ComponentCodeDomSerializer.cs (1)
364if (manager.GetService(typeof(IServiceContainer)) is ServiceContainer sc)
System\ComponentModel\Design\ServiceContainerExtensions.cs (3)
8public static void AddService<T>(this IServiceContainer serviceContainer, T serviceInstance) where T : class => 11public static void AddService<T>(this IServiceContainer serviceContainer, ServiceCreatorCallback callback) => 14public static void RemoveService<T>(this IServiceContainer serviceContainer) => serviceContainer.RemoveService(typeof(T));
System\ComponentModel\Design\SiteNestedContainer.cs (1)
100if (serviceType == typeof(IServiceContainer))
System\Windows\Forms\Design\DocumentDesigner.cs (1)
1022private object OnCreateService(IServiceContainer container, Type serviceType)
System.Windows.Forms.Design.Tests (33)
System\ComponentModel\Design\ComponentDesignerTests.cs (4)
2167.As<IServiceContainer>() 2180mockSite.As<IServiceContainer>().Verify(s => s.AddService(typeof(DesignerCommandSet), set), Times.Once()); 2223.As<IServiceContainer>() 2238mockSite.As<IServiceContainer>().Verify(s => s.AddService(typeof(DesignerCommandSet), It.IsAny<DesignerCommandSet>()), Times.Never());
System\ComponentModel\Design\DesignerActionServiceTests.cs (8)
399.As<IServiceContainer>() 406.As<IServiceContainer>() 420.As<IServiceContainer>() 434.As<IServiceContainer>() 453.As<IServiceContainer>() 488.As<IServiceContainer>() 532.As<IServiceContainer>() 588.As<IServiceContainer>()
System\ComponentModel\Design\DesignerHostTests.cs (16)
1069IServiceContainer container = Assert.IsAssignableFrom<IServiceContainer>(component.Site); 1095.Setup(p => p.GetService(typeof(IServiceContainer))) 1102IServiceContainer container = Assert.IsAssignableFrom<IServiceContainer>(component.Site); 1132IServiceContainer container = Assert.IsAssignableFrom<IServiceContainer>(component.Site); 1166IServiceContainer container = Assert.IsAssignableFrom<IServiceContainer>(component.Site); 1197.Setup(p => p.GetService(typeof(IServiceContainer))) 1204IServiceContainer container = Assert.IsAssignableFrom<IServiceContainer>(component.Site); 1239IServiceContainer container = Assert.IsAssignableFrom<IServiceContainer>(component.Site); 1573Assert.Same(surface.ServiceContainer, component.Site.GetService(typeof(IServiceContainer))); 2359[InlineData(typeof(IServiceContainer))]
System\ComponentModel\Design\DesignSurfaceTests.cs (1)
1535[InlineData(typeof(IServiceContainer))]
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationServiceTests.cs (4)
209.Setup(p => p.GetService(typeof(IServiceContainer))) 235mockServiceProvider.Verify(p => p.GetService(typeof(IServiceContainer)), Times.Once()); 301.Setup(p => p.GetService(typeof(IServiceContainer))) 335mockServiceProvider.Verify(p => p.GetService(typeof(IServiceContainer)), Times.Once());