WeakReference<T> Class
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents a typed weak reference, which references an object while still allowing that object to be reclaimed by garbage collection.
generic <typename T>
where T : classpublic ref class WeakReference sealed
generic <typename T>
where T : classpublic ref class WeakReference sealed : System::Runtime::Serialization::ISerializable
public sealed class WeakReference<T> where T : class
public sealed class WeakReference<T> : System.Runtime.Serialization.ISerializable where T : class
[System.Serializable]
public sealed class WeakReference<T> : System.Runtime.Serialization.ISerializable where T : class
type WeakReference<'T (requires 'T : null)> = class
type WeakReference<'T (requires 'T : null)> = class
interface ISerializable
[<System.Serializable>]
type WeakReference<'T (requires 'T : null)> = class
interface ISerializable
Public NotInheritable Class WeakReference(Of T)
Public NotInheritable Class WeakReference(Of T)
Implements ISerializable
- T
The type of the object referenced.
- Inheritance
-
WeakReference<T>
- Attributes
- Implements
A weak reference enables the garbage collector to collect an object while still allowing an application to access the object. If you need the object, you can obtain a strong reference to it and prevent it from being collected.
Weak |
Initializes a new instance of the WeakReference<T> class that references the specified object and uses the specified resurrection tracking. |
Weak |
Initializes a new instance of the WeakReference<T> class that references the specified object. |
Equals(Object) |
Determines whether the specified object is equal to the current object. (Inherited from Object) |
Finalize() |
Discards the reference to the target that is represented by the current WeakReference<T> object. |
Get |
Serves as the default hash function. (Inherited from Object) |
Get |
Obsolete.
Populates a SerializationInfo object with all the data necessary to serialize the current WeakReference<T> object. |
Get |
Gets the Type of the current instance. (Inherited from Object) |
Memberwise |
Creates a shallow copy of the current Object. (Inherited from Object) |
Set |
Sets the target object that is referenced by this WeakReference<T> object. |
To |
Returns a string that represents the current object. (Inherited from Object) |
Try |
Tries to retrieve the target object that is referenced by the current WeakReference<T> object. |
Produkt | Verze |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1 |
UWP | 10.0 |
Zpětná vazba k produktu .NET
.NET je open source projekt. Vyberte odkaz pro poskytnutí zpětné vazby: