ClassWeakReferenceList<T>
Wraps instances of type T in WeakReference and stores them in a List.
Definition
Namespace:Telerik.Core
Assembly:Telerik.WinUI.Controls.dll
Type Parameters:
T
Syntax:
public class WeakReferenceList<T> : IEnumerable<T>, IEnumerable where T : class
Inheritance: objectWeakReferenceList<T>
Implements:
Constructors
WeakReferenceList()
Initializes a new instance of the WeakReferenceList<T> class.
Declaration
public WeakReferenceList()
WeakReferenceList(bool)
Initializes a new instance of the WeakReferenceList<T> class.
Declaration
public WeakReferenceList(bool cleanNonAlive)
Parameters
cleanNonAlive
True to remove any non-alive instances automatically, false otherwise.
WeakReferenceList(bool, bool)
Initializes a new instance of the WeakReferenceList<T> class.
Properties
AutoCleanNonAlive
Gets or sets a value indicating whether the list will automatically remove any contained non-alive weak reference.
Count
Gets the count of the list.
List
Gets the internal List used to store all instances.
Declaration
protected List<WeakReference<T>> List { get; }
Property Value
List<WeakReference<T>>
TrackResurrection
Gets or sets a value indicating whether resurrection for all added instances should be tracked.
Methods
Add(T)
Adds the specified value.
Declaration
public void Add(T value)
Parameters
value
T
The value.
CleanNonAlive()
Cleans all targets that are no longer alive.
Declaration
public void CleanNonAlive()
Contains(T)
Gets a value indicating whether the item is present in the list.
GetEnumerator()
Gets the enumerator that iterates through all items.
Declaration
public IEnumerator<T> GetEnumerator()
Returns
IEnumerator<T>
Implements
IndexOf(T)
Gets the index of the specified value within the list.
Declaration
public int IndexOf(T value)
Parameters
value
T
The value to check for.
Returns
The index of the item.
Insert(int, T)
Inserts an item at the specified index.
Declaration
public void Insert(int index, T value)
Parameters
index
The index.
value
T
The value.
InsertCore(int, T)
Core insert implementation. Allows inheritors to provide their own implementation.
Declaration
protected virtual void InsertCore(int index, T value)
Parameters
index
The index.
value
T
The value.
Remove(T)
Removes the specified value.
Declaration
public void Remove(T value)
Parameters
value
T
The value.
RemoveAt(int)
Removes the value at the specified index.