C# Класс Ninject.KernelBase

Наследование: BindingRoot, IKernel
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание

Открытые методы

Метод Описание
AddBinding ( IBinding binding ) : void

Registers the specified binding.

BeginBlock ( ) : IActivationBlock

Begins a new activation block, which can be used to deterministically dispose resolved instances.

BuildReadonlyKernel ( ) : IReadOnlyKernel
CanResolve ( IRequest request ) : bool

Determines whether the specified request can be resolved.

CanResolve ( IRequest request, bool ignoreImplicitBindings ) : bool

Determines whether the specified request can be resolved.

CreateRequest ( Type service, bool>.Func constraint, IEnumerable parameters, bool isOptional, bool isUnique ) : IRequest

Creates a request for the specified service.

Dispose ( bool disposing ) : void

Releases resources held by the object.

GetBindings ( Type service ) : IEnumerable

Gets the bindings registered for the specified service.

GetModules ( ) : IEnumerable

Gets the modules that have been loaded into the kernel.

GetService ( Type serviceType ) : object
HasModule ( string name ) : bool

Determines whether a module with the specified name has been loaded in the kernel.

Inject ( object instance ) : void

Injects the specified existing instance, without managing its lifecycle.

Load ( IEnumerable assemblies ) : void

Loads modules defined in the specified assemblies.

Load ( IEnumerable m ) : void

Loads the module(s) into the kernel.

Load ( IEnumerable filePatterns ) : void

Loads modules from the files that match the specified pattern(s).

Release ( object instance ) : bool

Deactivates and releases the specified instance if it is currently managed by Ninject.

RemoveBinding ( IBinding binding ) : void

Unregisters the specified binding.

Resolve ( IRequest request ) : IEnumerable

Resolves instances for the specified request. The instances are not actually resolved until a consumer iterates over the enumerator.

Unbind ( Type service ) : void

Unregisters all bindings for the specified service.

Unload ( string name ) : void

Unloads the plugin with the specified name.

Защищенные методы

Метод Описание
KernelBase ( ) : System

Initializes a new instance of the KernelBase class.

KernelBase ( IComponentContainer components, INinjectSettings settings ) : System

Initializes a new instance of the KernelBase class.

KernelBase ( INinjectSettings settings ) : System

Initializes a new instance of the KernelBase class.

Описание методов

AddBinding() публичный Метод

Registers the specified binding.
public AddBinding ( IBinding binding ) : void
binding IBinding The binding to add.
Результат void

BeginBlock() публичный Метод

Begins a new activation block, which can be used to deterministically dispose resolved instances.
public BeginBlock ( ) : IActivationBlock
Результат IActivationBlock

BuildReadonlyKernel() публичный Метод

public BuildReadonlyKernel ( ) : IReadOnlyKernel
Результат IReadOnlyKernel

CanResolve() публичный Метод

Determines whether the specified request can be resolved.
public CanResolve ( IRequest request ) : bool
request IRequest The request.
Результат bool

CanResolve() публичный Метод

Determines whether the specified request can be resolved.
public CanResolve ( IRequest request, bool ignoreImplicitBindings ) : bool
request IRequest The request.
ignoreImplicitBindings bool if set to true implicit bindings are ignored.
Результат bool

CreateRequest() публичный Метод

Creates a request for the specified service.
public CreateRequest ( Type service, bool>.Func constraint, IEnumerable parameters, bool isOptional, bool isUnique ) : IRequest
service System.Type The service that is being requested.
constraint bool>.Func The constraint to apply to the bindings to determine if they match the request.
parameters IEnumerable The parameters to pass to the resolution.
isOptional bool True if the request is optional; otherwise, false.
isUnique bool True if the request should return a unique result; otherwise, false.
Результат IRequest

Dispose() публичный Метод

Releases resources held by the object.
public Dispose ( bool disposing ) : void
disposing bool True if called manually, otherwise by GC.
Результат void

GetBindings() публичный Метод

Gets the bindings registered for the specified service.
public GetBindings ( Type service ) : IEnumerable
service System.Type The service in question.
Результат IEnumerable

GetModules() публичный Метод

Gets the modules that have been loaded into the kernel.
public GetModules ( ) : IEnumerable
Результат IEnumerable

GetService() публичный Метод

public GetService ( Type serviceType ) : object
serviceType System.Type
Результат object

HasModule() публичный Метод

Determines whether a module with the specified name has been loaded in the kernel.
public HasModule ( string name ) : bool
name string The name of the module.
Результат bool

Inject() публичный Метод

Injects the specified existing instance, without managing its lifecycle.
public Inject ( object instance ) : void
instance object The instance to inject.
Результат void

KernelBase() защищенный Метод

Initializes a new instance of the KernelBase class.
protected KernelBase ( ) : System
Результат System

KernelBase() защищенный Метод

Initializes a new instance of the KernelBase class.
protected KernelBase ( IComponentContainer components, INinjectSettings settings ) : System
components IComponentContainer The component container to use.
settings INinjectSettings The configuration to use.
Результат System

KernelBase() защищенный Метод

Initializes a new instance of the KernelBase class.
protected KernelBase ( INinjectSettings settings ) : System
settings INinjectSettings The configuration to use.
Результат System

Load() публичный Метод

Loads modules defined in the specified assemblies.
public Load ( IEnumerable assemblies ) : void
assemblies IEnumerable The assemblies to search.
Результат void

Load() публичный Метод

Loads the module(s) into the kernel.
public Load ( IEnumerable m ) : void
m IEnumerable The modules to load.
Результат void

Load() публичный Метод

Loads modules from the files that match the specified pattern(s).
public Load ( IEnumerable filePatterns ) : void
filePatterns IEnumerable The file patterns (i.e. "*.dll", "modules/*.rb") to match.
Результат void

Release() публичный Метод

Deactivates and releases the specified instance if it is currently managed by Ninject.
public Release ( object instance ) : bool
instance object The instance to release.
Результат bool

RemoveBinding() публичный Метод

Unregisters the specified binding.
public RemoveBinding ( IBinding binding ) : void
binding IBinding The binding to remove.
Результат void

Resolve() публичный Метод

Resolves instances for the specified request. The instances are not actually resolved until a consumer iterates over the enumerator.
public Resolve ( IRequest request ) : IEnumerable
request IRequest The request to resolve.
Результат IEnumerable

Unbind() публичный Метод

Unregisters all bindings for the specified service.
public Unbind ( Type service ) : void
service System.Type The service to unbind.
Результат void

Unload() публичный Метод

Unloads the plugin with the specified name.
public Unload ( string name ) : void
name string The plugin's name.
Результат void