The ServiceContainer type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
| ServiceContainer |
Initializes a new instance of the ServiceContainer class.
|
Methods
| Name | Description | |
|---|---|---|
| Clear |
Resets the container and removes all locally registered service types.
| |
| CreateChildContainer |
Creates a new child container.
| |
| CreateInstance |
Creates an instance the given type and satisfies the constructor dependencies.
| |
| Dispose()()()() |
Releases all resources used by an instance of the ServiceContainer class.
| |
| Dispose(Boolean) |
Releases the unmanaged resources used by an instance of the ServiceContainer class
and optionally releases the managed resources.
| |
| Equals | (Inherited from Object.) | |
| Finalize |
Releases unmanaged resources before an instance of the ServiceContainer class
is reclaimed by garbage collection.
(Overrides Object..::..Finalize()()()().) | |
| GetAllInstances(Type) |
Gets all named instances of the given service type currently registered in the container.
| |
| GetAllInstances<(Of <<'(TService>)>>)()()()() |
Gets all named instances of the given service type currently registered in the container.
| |
| GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
| GetInstance(Type) |
Get an instance of the given service type.
| |
| GetInstance(Type, String) |
Gets a named instance of the given service type.
| |
| GetInstance<(Of <<'(TService>)>>)()()()() |
Gets an instance of the given service type.
| |
| GetInstance<(Of <<'(TService>)>>)(String) |
Gets a named instance of the given service type.
| |
| GetType | Gets the Type of the current instance. (Inherited from Object.) | |
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
| OnCreateChildContainer |
Called when a new child container needs to be created.
| |
| OnCreateInstance |
Creates an instance of the type with the specified constructor arguments.
| |
| Register(Type, String, Func<(Of <<'(ServiceContainer, Object>)>>)) |
Registers a services using a custom factory method.
| |
| Register(Type, String, Object) |
Registers the specified service instance.
| |
| Register(Type, String, Type) |
Registers the specified service type.
| |
| Register(Type, String, Func<(Of <<'(ServiceContainer, Object>)>>), CreationPolicy) |
Registers a services using a custom factory method and a certain creation policy.
| |
| Register(Type, String, Type, CreationPolicy) |
Registers the specified service type using a certain creation policy.
| |
| Register(Type, String, Func<(Of <<'(ServiceContainer, Object>)>>), CreationPolicy, DisposalPolicy) |
Registers a service using a custom factory method and certain creation and disposal
policies.
| |
| Register(Type, String, Type, CreationPolicy, DisposalPolicy) |
Registers the specified service type using a certain creation and disposal policy.
| |
| ResolveProperties |
Tries to resolve all property dependencies of the given instance.
| |
| SelectConstructor |
Selects the constructor to be used for activating the given type.
| |
| ToString | Returns a string that represents the current object. (Inherited from Object.) | |
| Unregister(Type) |
Unregisters all services of the given service type.
| |
| Unregister(Type, String) |
Unregisters the service with the specified name.
|
Extension Methods
| Name | Description | |
|---|---|---|
| GetService<(Of <<'(T>)>>) |
Gets a service from a service provider. If the provider does not contain
the service an ServiceNotFoundException is thrown.
(Defined by ServiceManager.) | |
| TryGetService<(Of <<'(T>)>>) |
Tries to get a service from a service provider.
(Defined by ServiceManager.) |
Explicit Interface Implementations
| Name | Description | |
|---|---|---|
| IEnumerable..::..GetEnumerator |
Returns an enumerator that iterates through all registered services.
| |
| IServiceProvider..::..GetService |
Gets the service instance of the specified type.
|