<PackageReference Include="Castle.Windsor" Version="5.1.2" />

WindsorContainer

Implementation of IWindsorContainer which delegates to IKernel implementation.

public virtual IKernel Kernel { get; }

Returns the inner instance of the MicroKernel

public string Name { get; }

Gets the container's name

public virtual IWindsorContainer Parent { get; set; }

Gets or sets the parent container if this instance is a sub container.

Constructs a container without any external configuration reference

Constructs a container using the specified IConfigurationStore implementation.

Constructs a container using the specified IConfigurationInterpreter implementation.

public WindsorContainer(IConfigurationInterpreter interpreter, IEnvironmentInfo environmentInfo)

Initializes a new instance of the WindsorContainer class.

public WindsorContainer(string configurationUri)

Initializes a new instance of the WindsorContainer class using a resource pointed to by the parameter. That may be a file, an assembly embedded resource, a UNC path or a config file section.

Equivalent to the use of new WindsorContainer(new XmlInterpreter(configurationUri))

public WindsorContainer(IKernel kernel, IComponentsInstaller installer)

Constructs a container using the specified IKernel implementation. Rarely used.

public WindsorContainer(string name, IKernel kernel, IComponentsInstaller installer)

Constructs a container using the specified IKernel implementation. Rarely used.

public WindsorContainer(IProxyFactory proxyFactory)

Constructs with a given IProxyFactory.

Constructs a container assigning a parent container before starting the dependency resolution.

public WindsorContainer(string name, IWindsorContainer parent, IConfigurationInterpreter interpreter)

Initializes a new instance of the WindsorContainer class.

public virtual void AddChildContainer(IWindsorContainer childContainer)

Registers a subcontainer. The components exposed by this container will be accessible from subcontainers.

Registers a facility within the container.

public IWindsorContainer AddFacility<T>() where T : IFacility

Creates and adds an IFacility facility to the container.

public IWindsorContainer AddFacility<T>(Action<T> onCreate) where T : IFacility

Creates and adds an IFacility facility to the container.

public virtual void Dispose()

Executes Dispose on underlying IKernel

Gets a child container instance by name.

Runs the installers so that they can register components in the container.

public IWindsorContainer Register(IRegistration[] registrations)

Registers the components with the IWindsorContainer. The instances of IRegistration are produced by fluent registration API. Most common entry points are For<T> method to register a single type or (recommended in most cases) FromAssembly. Let the Intellisense drive you through the fluent API past those entry points.

public virtual void Release(object instance)

Releases a component instance

public virtual void RemoveChildContainer(IWindsorContainer childContainer)

Removes (unregisters) a subcontainer. The components exposed by this container will no longer be accessible to the child container.

public virtual object Resolve(Type service, Arguments arguments)

Returns a component instance by the service

public virtual object Resolve(Type service)

Returns a component instance by the service

public virtual object Resolve(string key, Type service)

Returns a component instance by the key

public virtual object Resolve(string key, Type service, Arguments arguments)

Returns a component instance by the key

public T Resolve<T>(Arguments arguments)

Returns a component instance by the service

public virtual T Resolve<T>(string key, Arguments arguments)

Returns a component instance by the key

public T Resolve<T>()

Returns a component instance by the service

public virtual T Resolve<T>(string key)

Returns a component instance by the key

public T[] ResolveAll<T>()

Resolve all valid components that match this type.

public Array ResolveAll(Type service)

Resolve all valid components that match this type.

public Array ResolveAll(Type service, Arguments arguments)

Resolve all valid components that match this type by passing dependencies as arguments.

public T[] ResolveAll<T>(Arguments arguments)

Resolve all valid components that match this type. The service typeArguments to resolve the service

protected virtual void RunInstaller()