Class ExternallyControlledLifetimeManager
A LifetimeManager that holds a weak reference to it's managed instance.
public class ExternallyControlledLifetimeManager : SynchronizedLifetimeManager, IDisposable, IInstanceLifetimeManager, ITypeLifetimeManager, IFactoryLifetimeManager
- Inheritance
-
ExternallyControlledLifetimeManager
- Implements
- Inherited Members
- Extension Methods
Methods
OnCreateLifetimeManager()
Implementation of CreateLifetimePolicy() policy.
protected override LifetimeManager OnCreateLifetimeManager()
Returns
- LifetimeManager
A new instance of the same lifetime manager of appropriate type
RemoveValue(ILifetimeContainer)
Remove the given object from backing store.
public override void RemoveValue(ILifetimeContainer container = null)
Parameters
container
ILifetimeContainerThe container this lifetime belongs to
SynchronizedGetValue(ILifetimeContainer)
Performs the actual retrieval of a value from the backing store associated with this Lifetime policy.
protected override object SynchronizedGetValue(ILifetimeContainer container = null)
Parameters
container
ILifetimeContainerInstance of the lifetime's container
Returns
- object
the object desired, or null if no such object is currently stored.
Remarks
This method is invoked by GetValue(ILifetimeContainer) after it has acquired its lock.
SynchronizedSetValue(object, ILifetimeContainer)
Performs the actual storage of the given value into backing store for retrieval later.
protected override void SynchronizedSetValue(object newValue, ILifetimeContainer container = null)
Parameters
newValue
objectThe object being stored.
container
ILifetimeContainerInstance of the lifetime's container
Remarks
This method is invoked by SetValue(object, ILifetimeContainer) before releasing its lock.
ToString()
public override string ToString()