| ServiceContainerRegister Method (Type, String, Type, CreationPolicy, DisposalPolicy) |
Registers the specified service type using a certain creation and disposal policy.
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,
Type instanceType,
CreationPolicy creationPolicy,
DisposalPolicy disposalPolicy
)
Public Sub Register (
serviceType As Type,
key As String,
instanceType As Type,
creationPolicy As CreationPolicy,
disposalPolicy As DisposalPolicy
)
public:
void Register(
Type^ serviceType,
String^ key,
Type^ instanceType,
CreationPolicy creationPolicy,
DisposalPolicy disposalPolicy
)
member Register :
serviceType : Type *
key : string *
instanceType : Type *
creationPolicy : CreationPolicy *
disposalPolicy : DisposalPolicy -> 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.
- instanceType
- Type: SystemType
The type implementing the service. - creationPolicy
- Type: DigitalRune.ServiceLocationCreationPolicy
The creation policy that specifies when and how a service will be instantiated.
- disposalPolicy
- Type: DigitalRune.ServiceLocationDisposalPolicy
The disposal policy that specifies when a service instance will be disposed. (Only
relevant if the service instance implements IDisposable.)
Exceptions Remarks
If a service with the same type and name is already registered, the existing entry will
be replaced.
See Also