Is there a way to do WeakList (think WeakReference) in CLR?
- by Tim Lovell-Smith
A List does not work in the way that I want. The way that I want is that WeakReferences are automatically removed from the list when the object they weakly reference is garbage collected.
ConditionalWeakTable does not do what I want either, because although its keys and values are weakly referenced and collectable, you cannot enumerate them at all.