Share via


WeakCollection<T> Class

Definition

Microsoft internal use only.

generic <typename T>
 where T : classpublic ref class WeakCollection : System::Collections::Generic::IEnumerable<T>
public class WeakCollection<T> : System.Collections.Generic.IEnumerable<T> where T : class
type WeakCollection<'T (requires 'T : null)> = class
    interface seq<'T (requires 'T : null)>
    interface IEnumerable
Public Class WeakCollection(Of T)
Implements IEnumerable(Of T)

Type Parameters

T
Inheritance
WeakCollection<T>
Implements

Constructors

WeakCollection<T>()

Microsoft internal use only.

Methods

Add(T)

Adds a WeakReference to the item to the collection.

Clear()

Clears all items from the list.

GetAliveItemsCount()

Return the number of strong references remaining in the collection. Note that this is O(n), where n is the number of WeakReferences currently in the list.

Remove(T)

Removes an item from the underlying collection, if it exists. This is O(n), where n is the number of WeakReferences currently in the list.

ToList()

Gets a list containing strong references to the items in this collection.

Explicit Interface Implementations

IEnumerable.GetEnumerator()

Microsoft internal use only.

IEnumerable<T>.GetEnumerator()

Microsoft internal use only.

Extension Methods

EmptyIfNull<T>(IEnumerable<T>)

Return this enumeration in case it is not null. In case it is null return empty enumeration.

Applies to