Click or drag to resize

WeakReferenceT Class

A typed version of the WeakReference
Inheritance Hierarchy
SystemObject
  SystemWeakReference
    TomsToolbox.CoreWeakReferenceT

Namespace:  TomsToolbox.Core
Assembly:  TomsToolbox.Core (in TomsToolbox.Core.dll) Version: 1.0.68.0
Syntax
[SerializableAttribute]
public sealed class WeakReference<T> : WeakReference
where T : class

Type Parameters

T
The type of the object that is tracked.

The WeakReferenceT type exposes the following members.

Constructors
  NameDescription
Public methodWeakReferenceT(T)
Initializes a new instance of the WeakReferenceT class.
Public methodWeakReferenceT(T, Boolean)
Initializes a new instance of the WeakReferenceT class.
Top
Properties
  NameDescription
Public propertyTarget
Gets or sets the object (the target) referenced by the current WeakReference object.

[CanBeNull]

Top
Methods
  NameDescription
Public methodTryGetTarget
Tries to the get the target.
Top
Extension Methods
  NameDescription
Public Extension MethodSafeCastT
Performs a cast from object to T, avoiding possible null violations if T is a value type.

[CanBeNull]

(Defined by ObjectExtensions.)
Top
See Also