WeakReference<T> Class
.NET Framework 4.5
Represents a typed weak reference, which references an object while still allowing that object to be reclaimed by garbage collection.
Namespace:
System
Assembly: mscorlib (in mscorlib.dll)
The WeakReference<T> type exposes the following members.
| Name | Description | |
|---|---|---|
![]() ![]() | WeakReference<T>(T) | Initializes a new instance of the WeakReference<T> class that references the specified object. |
![]() ![]() | WeakReference<T>(T, Boolean) | Initializes a new instance of the WeakReference<T> class that references the specified object and uses the specified resurrection tracking. |
| Name | Description | |
|---|---|---|
![]() ![]() | Equals(Object) | Determines whether the specified object is equal to the current object. (Inherited from Object.) |
![]() ![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetObjectData | Populates a SerializationInfo object with all the data necessary to serialize the current WeakReference<T> object. |
![]() ![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() ![]() | SetTarget | Sets the target object that is referenced by this WeakReference<T> object. |
![]() ![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
![]() ![]() | TryGetTarget | Tries to retrieve the target object that is referenced by the current WeakReference<T> object. |
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

