Class PooledObjectWrapper<T>
- Namespace
- CodeProject.ObjectPool
- Assembly
- CodeProject.ObjectPool.dll
PooledObject wrapper, for classes which cannot inherit from that class.
[Serializable]
public sealed class PooledObjectWrapper<T> : PooledObject, IDisposable, IEquatable<PooledObject> where T : class
Type Parameters
T
The type of the resource.
- Inheritance
-
PooledObjectWrapper<T>
- Implements
- Inherited Members
Constructors
PooledObjectWrapper(T)
Wraps a given resource so that it can be put in the pool.
public PooledObjectWrapper(T resource)
Parameters
resource
TThe resource to be wrapped.
Properties
InternalResource
The resource wrapped inside this class.
public T InternalResource { get; }
Property Value
- T
OnReleaseResources
Triggered by the pool manager when there is no need for this object anymore.
public Action<T>? OnReleaseResources { get; set; }
Property Value
- Action<T>
OnResetState
Triggered by the pool manager just before the object is being returned to the pool. If reset cannot be successfully performed, delegates can throw ResetStateFailureException in order to let the pool know that the object should be released.
public Action<T>? OnResetState { get; set; }
Property Value
- Action<T>