C# Class Ninject.KernelBase

Inheritance: BindingRoot, IKernel
Afficher le fichier Open project: ninject/Ninject Class Usage Examples

Private Properties

Свойство Type Description

Méthodes publiques

Méthode Description
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.

Méthodes protégées

Méthode Description
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.

Method Details

AddBinding() public méthode

Registers the specified binding.
public AddBinding ( IBinding binding ) : void
binding IBinding The binding to add.
Résultat void

BeginBlock() public méthode

Begins a new activation block, which can be used to deterministically dispose resolved instances.
public BeginBlock ( ) : IActivationBlock
Résultat IActivationBlock

BuildReadonlyKernel() public méthode

public BuildReadonlyKernel ( ) : IReadOnlyKernel
Résultat IReadOnlyKernel

CanResolve() public méthode

Determines whether the specified request can be resolved.
public CanResolve ( IRequest request ) : bool
request IRequest The request.
Résultat bool

CanResolve() public méthode

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.
Résultat bool

CreateRequest() public méthode

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.
Résultat IRequest

Dispose() public méthode

Releases resources held by the object.
public Dispose ( bool disposing ) : void
disposing bool True if called manually, otherwise by GC.
Résultat void

GetBindings() public méthode

Gets the bindings registered for the specified service.
public GetBindings ( Type service ) : IEnumerable
service System.Type The service in question.
Résultat IEnumerable

GetModules() public méthode

Gets the modules that have been loaded into the kernel.
public GetModules ( ) : IEnumerable
Résultat IEnumerable

GetService() public méthode

public GetService ( Type serviceType ) : object
serviceType System.Type
Résultat object

HasModule() public méthode

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.
Résultat bool

Inject() public méthode

Injects the specified existing instance, without managing its lifecycle.
public Inject ( object instance ) : void
instance object The instance to inject.
Résultat void

KernelBase() protected méthode

Initializes a new instance of the KernelBase class.
protected KernelBase ( ) : System
Résultat System

KernelBase() protected méthode

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.
Résultat System

KernelBase() protected méthode

Initializes a new instance of the KernelBase class.
protected KernelBase ( INinjectSettings settings ) : System
settings INinjectSettings The configuration to use.
Résultat System

Load() public méthode

Loads modules defined in the specified assemblies.
public Load ( IEnumerable assemblies ) : void
assemblies IEnumerable The assemblies to search.
Résultat void

Load() public méthode

Loads the module(s) into the kernel.
public Load ( IEnumerable m ) : void
m IEnumerable The modules to load.
Résultat void

Load() public méthode

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.
Résultat void

Release() public méthode

Deactivates and releases the specified instance if it is currently managed by Ninject.
public Release ( object instance ) : bool
instance object The instance to release.
Résultat bool

RemoveBinding() public méthode

Unregisters the specified binding.
public RemoveBinding ( IBinding binding ) : void
binding IBinding The binding to remove.
Résultat void

Resolve() public méthode

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.
Résultat IEnumerable

Unbind() public méthode

Unregisters all bindings for the specified service.
public Unbind ( Type service ) : void
service System.Type The service to unbind.
Résultat void

Unload() public méthode

Unloads the plugin with the specified name.
public Unload ( string name ) : void
name string The plugin's name.
Résultat void