| ServiceContainerRegister Method (Type, String, Object) |
Registers the specified service instance.
Namespace: DigitalRune.ServiceLocationAssembly: DigitalRune.ServiceLocation (in DigitalRune.ServiceLocation.dll) Version: 1.3.0.0 (1.3.0.13596)
Syntax public void Register(
Type serviceType,
string key,
Object instance
)
Public Sub Register (
serviceType As Type,
key As String,
instance As Object
)
public:
void Register(
Type^ serviceType,
String^ key,
Object^ instance
)
member Register :
serviceType : Type *
key : string *
instance : Object -> unit
Parameters
- serviceType
- Type: SystemType
The type of the service. - key
- Type: SystemString
The name under which the object should be registered. Can be or
empty.
- instance
- Type: SystemObject
The service instance to be registered.
Exceptions Remarks
The service instance will be shared by the container and all child containers (creation
policy Shared) and will not be disposed when the container
is disposed (disposal policy Manual).
If a service with the same type and name is already registered, the existing entry will
be replaced.
See Also