The ServiceContainer type exposes the following members.

Constructors

  NameDescription
Public methodServiceContainer
Initializes a new instance of the ServiceContainer class.

Methods

  NameDescription
Public methodClear
Resets the container and removes all locally registered service types.
Public methodCreateChildContainer
Creates a new child container.
Public methodCreateInstance
Creates an instance the given type and satisfies the constructor dependencies.
Public methodDispose()()()()
Releases all resources used by an instance of the ServiceContainer class.
Protected methodDispose(Boolean)
Releases the unmanaged resources used by an instance of the ServiceContainer class and optionally releases the managed resources.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Releases unmanaged resources before an instance of the ServiceContainer class is reclaimed by garbage collection.
(Overrides Object..::..Finalize()()()().)
Public methodGetAllInstances(Type)
Gets all named instances of the given service type currently registered in the container.
Public methodGetAllInstances<(Of <<'(TService>)>>)()()()()
Gets all named instances of the given service type currently registered in the container.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetInstance(Type)
Get an instance of the given service type.
Public methodGetInstance(Type, String)
Gets a named instance of the given service type.
Public methodGetInstance<(Of <<'(TService>)>>)()()()()
Gets an instance of the given service type.
Public methodGetInstance<(Of <<'(TService>)>>)(String)
Gets a named instance of the given service type.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodOnCreateChildContainer
Called when a new child container needs to be created.
Protected methodOnCreateInstance
Creates an instance of the type with the specified constructor arguments.
Public methodRegister(Type, String, Func<(Of <<'(ServiceContainer, Object>)>>))
Registers a services using a custom factory method.
Public methodRegister(Type, String, Object)
Registers the specified service instance.
Public methodRegister(Type, String, Type)
Registers the specified service type.
Public methodRegister(Type, String, Func<(Of <<'(ServiceContainer, Object>)>>), CreationPolicy)
Registers a services using a custom factory method and a certain creation policy.
Public methodRegister(Type, String, Type, CreationPolicy)
Registers the specified service type using a certain creation policy.
Public methodRegister(Type, String, Func<(Of <<'(ServiceContainer, Object>)>>), CreationPolicy, DisposalPolicy)
Registers a service using a custom factory method and certain creation and disposal policies.
Public methodRegister(Type, String, Type, CreationPolicy, DisposalPolicy)
Registers the specified service type using a certain creation and disposal policy.
Public methodResolveProperties
Tries to resolve all property dependencies of the given instance.
Protected methodSelectConstructor
Selects the constructor to be used for activating the given type.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUnregister(Type)
Unregisters all services of the given service type.
Public methodUnregister(Type, String)
Unregisters the service with the specified name.

Extension Methods

  NameDescription
Public Extension MethodGetService<(Of <<'(T>)>>)
Gets a service from a service provider. If the provider does not contain the service an ServiceNotFoundException is thrown.
(Defined by ServiceManager.)
Public Extension MethodTryGetService<(Of <<'(T>)>>)
Tries to get a service from a service provider.
(Defined by ServiceManager.)

Explicit Interface Implementations

  NameDescription
Explicit interface implemetationPrivate methodIEnumerable..::..GetEnumerator
Returns an enumerator that iterates through all registered services.
Explicit interface implemetationPrivate methodIServiceProvider..::..GetService
Gets the service instance of the specified type.

See Also