ObjectPool
Represents a pool of reusable objects to optimize memory usage and improve performance by minimizing the cost of object creation and destruction.
Definition
Namespace:Telerik.Windows.Documents.UI
Assembly:Telerik.Windows.Controls.RichTextBox.dll
Syntax:
public class ObjectPool
Inheritance: objectObjectPool
Constructors
public ObjectPool()
Methods
Clears the object pool associated with the specified PoolId.
public void ClearPool(ObjectPool.PoolId poolId)
The identifier of the pool to be cleared.
Creates an instance of the specified type T from the object pool.
public T CreateObject<T>() where T : new()
T
An instance of the specified type T from the object pool.
Creates an object of the specified type from the object pool identified by the given PoolId.
public T CreateObject<T>(ObjectPool.PoolId poolID) where T : new()
The identifier of the object pool from which to create the object.
Returns:T
A new instance of the specified type T retrieved from the object pool.
Releases an object back to the specified object pool for reuse.
public void ReleaseObject(object obj, ObjectPool.PoolId poolID)
The object to be released.
poolIDObjectPool.PoolIdThe identifier of the object pool to which the object is being released.
Releases the specified object back to the object pool for reuse.