<PackageReference Include="castle.windsor" Version="2.5.2" />

IKernel

public interface IKernel : IServiceProviderEx, IServiceProvider, IKernelEvents, IDisposable
The IKernel interface exposes all the functionality the MicroKernel implements.

Returns the implementation of IComponentModelBuilder

Gets or sets the implementation of IConfigurationStore

GraphNode[] GraphNodes { get; }

Graph of components and interactions.

Returns the implementation of IHandlerFactory

object this[string key] { get; }

Returns the component instance by the key

object this[Type service] { get; }

Returns the component instance by the service type

IKernel Parent { get; set; }

Returns the parent kernel

Gets or sets the implementation of IProxyFactory allowing different strategies for proxy creation.

Gets or sets the implementation for IReleasePolicy

Returns the implementation for IDependencyResolver

void AddChildKernel(IKernel kernel)

Support for kernel hierarchy

void AddComponent(string key, Type classType)

void AddComponent(string key, Type classType, LifestyleType lifestyle)

void AddComponent(string key, Type classType, LifestyleType lifestyle, bool overwriteLifestyle)

void AddComponent(string key, Type serviceType, Type classType)

void AddComponent(string key, Type serviceType, Type classType, LifestyleType lifestyle)

void AddComponent(string key, Type serviceType, Type classType, LifestyleType lifestyle, bool overwriteLifestyle)

void AddComponent<T>()

void AddComponent<T>(LifestyleType lifestyle)

void AddComponent<T>(LifestyleType lifestyle, bool overwriteLifestyle)

void AddComponent<T>(Type serviceType)

void AddComponent<T>(Type serviceType, LifestyleType lifestyle)

void AddComponent<T>(Type serviceType, LifestyleType lifestyle, bool overwriteLifestyle)

void AddComponentInstance<T>(object instance)

void AddComponentInstance<T>(Type serviceType, object instance)

void AddComponentInstance(string key, object instance)

void AddComponentInstance(string key, Type serviceType, object instance)

void AddComponentInstance(string key, Type serviceType, Type classType, object instance)

void AddComponentWithExtendedProperties(string key, Type classType, IDictionary extendedProperties)

void AddComponentWithExtendedProperties(string key, Type serviceType, Type classType, IDictionary extendedProperties)

IKernel AddFacility(string key, IFacility facility)

Adds a IFacility to the kernel.

IKernel AddFacility<T>(string key) where T : IFacility

Creates and adds an IFacility facility to the kernel.

IKernel AddFacility<T>(string key, Action<T> onCreate) where T : IFacility

Creates and adds an IFacility facility to the kernel.

IKernel AddFacility<T>(string key, Func<T, object> onCreate) where T : IFacility

Creates and adds an IFacility facility to the kernel.

IKernel AddFacility<T>() where T : IFacility

Creates and adds an IFacility facility to the kernel.

IKernel AddFacility<T>(Action<T> onCreate) where T : IFacility

Creates and adds an IFacility facility to the kernel.

IKernel AddFacility<T>(Func<T, object> onCreate) where T : IFacility

Creates and adds an IFacility facility to the kernel.

Register a new component resolver that can take part in the decision making about which handler to resolve

void AddSubSystem(string key, ISubSystem subsystem)

Adds (or replaces) an ISubSystem

Return handlers for components that implements the specified service. The check is made using IsAssignableFrom

Returns the facilities registered on the kernel.

IHandler GetHandler(string key)

Returns the IHandler for the specified component key.

Returns the IHandler for the specified service.

Return handlers for components that implements the specified service.

Returns an implementation of ISubSystem for the specified key. SubSystemConstants

bool HasComponent(string key)

Returns true if the specified key was registered

bool HasComponent(Type service)

Returns true if the specified service was registered

IKernel Register(IRegistration[] registrations)

Registers the components provided by the IRegistrations with the IKernel.

Create a new registration using Component.For() or AllTypes.

void RegisterCustomDependencies(Type service, IDictionary dependencies)

Associates objects with a component handler, allowing it to use the specified dictionary when resolving dependencies

void RegisterCustomDependencies(Type service, object dependenciesAsAnonymousType)

Associates objects with a component handler, allowing it to use the specified dictionary when resolving dependencies

void RegisterCustomDependencies(string key, IDictionary dependencies)

Associates objects with a component handler, allowing it to use the specified dictionary when resolving dependencies

void RegisterCustomDependencies(string key, object dependenciesAsAnonymousType)

Associates objects with a component handler, allowing it to use the specified dictionary when resolving dependencies

void ReleaseComponent(object instance)

Releases a component instance. This allows the kernel to execute the proper decommission lifecycles on the component instance.

Remove child kernel

bool RemoveComponent(string key)

Returns true if the specified component was found and could be removed (i.e. no other component depends on it)

object Resolve(Type service)

Returns the component instance by the service type

object Resolve(Type service, IDictionary arguments)

Returns the component instance by the service type using dynamic arguments

object Resolve(string key, IDictionary arguments)

Returns the component instance by the component key using dynamic arguments

object Resolve(Type service, object argumentsAsAnonymousType)

Returns the component instance by the service type using dynamic arguments

object Resolve(string key, object argumentsAsAnonymousType)

Returns the component instance by the component key using dynamic arguments

object Resolve(string key, Type service)

Returns a component instance by the key

T Resolve<T>(IDictionary arguments)

Returns the component instance by the service type using dynamic arguments

T Resolve<T>(object argumentsAsAnonymousType)

Returns the component instance by the service type using dynamic arguments

T Resolve<T>()

Returns the component instance by the component key

T Resolve<T>(string key)

Returns a component instance by the key

T Resolve<T>(string key, IDictionary arguments)

Returns a component instance by the key

object Resolve(string key, Type service, IDictionary arguments)

Returns a component instance by the key

Returns all the valid component instances by the service type

Array ResolveAll(Type service, IDictionary arguments)

Returns all the valid component instances by the service type

Array ResolveAll(Type service, object argumentsAsAnonymousType)

Returns all the valid component instances by the service type

TService[] ResolveAll<TService>()

Returns component instances that implement TService

TService[] ResolveAll<TService>(IDictionary arguments)

Returns component instances that implement TService

TService[] ResolveAll<TService>(object argumentsAsAnonymousType)

Returns component instances that implement TService