12 [__DynamicallyInvokable]
21 [__DynamicallyInvokable]
22 public virtual bool IsAlive
25 [SecuritySafeCritical]
26 [__DynamicallyInvokable]
33 [__DynamicallyInvokable]
34 public virtual bool TrackResurrection
36 [__DynamicallyInvokable]
39 return IsTrackResurrection();
47 [__DynamicallyInvokable]
48 public virtual object Target
51 [SecuritySafeCritical]
52 [__DynamicallyInvokable]
55 [SecuritySafeCritical]
56 [__DynamicallyInvokable]
62 [__DynamicallyInvokable]
64 : this(target, trackResurrection: false)
71 [__DynamicallyInvokable]
74 Create(target, trackResurrection);
88 object value = info.GetValue(
"TrackedObject", typeof(
object));
89 bool boolean = info.GetBoolean(
"TrackResurrection");
90 Create(value,
boolean);
95 [SecuritySafeCritical]
96 [__DynamicallyInvokable]
111 info.AddValue(
"TrackedObject",
Target, typeof(
object));
112 info.AddValue(
"TrackResurrection", IsTrackResurrection());
116 [SecuritySafeCritical]
117 private extern void Create(
object target,
bool trackResurrection);
120 [SecuritySafeCritical]
121 private extern bool IsTrackResurrection();
126 [__DynamicallyInvokable]
134 [SecuritySafeCritical]
137 [SecuritySafeCritical]
143 [__DynamicallyInvokable]
145 : this(target, trackResurrection: false)
153 [__DynamicallyInvokable]
156 Create(target, trackResurrection);
165 T target = (
T)info.GetValue(
"TrackedObject", typeof(
T));
166 bool boolean = info.GetBoolean(
"TrackResurrection");
167 Create(target,
boolean);
175 [__DynamicallyInvokable]
178 return (target =
Target) !=
null;
183 [__DynamicallyInvokable]
191 [SecuritySafeCritical]
206 info.AddValue(
"TrackedObject",
Target, typeof(
T));
207 info.AddValue(
"TrackResurrection", IsTrackResurrection());
211 [SecuritySafeCritical]
212 private extern void Create(
T target,
bool trackResurrection);
215 [SecuritySafeCritical]
216 private extern bool IsTrackResurrection();
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
Describes a set of security permissions applied to code. This class cannot be inherited.
WeakReference(SerializationInfo info, StreamingContext context)
Initializes a new instance of the T:System.WeakReference class, using deserialized data from the spec...
void GetObjectData(SerializationInfo info, StreamingContext context)
Populates a T:System.Runtime.Serialization.SerializationInfo object with all the data necessary to se...
WeakReference(object target)
Initializes a new instance of the T:System.WeakReference class, referencing the specified object.
WeakReference(T target)
Initializes a new instance of the T:System.WeakReference`1 class that references the specified object...
Describes the source and destination of a given serialized stream, and provides an additional caller-...
Represents a weak reference, which references an object while still allowing that object to be reclai...
SecurityAction
Specifies the security actions that can be performed using declarative security.
bool TryGetTarget(out T target)
Tries to retrieve the target object that is referenced by the current T:System.WeakReference`1 object...
WeakReference(T target, bool trackResurrection)
Initializes a new instance of the T:System.WeakReference`1 class that references the specified object...
A platform-specific type that is used to represent a pointer or a handle.
void SetTarget(T target)
Sets the target object that is referenced by this T:System.WeakReference`1 object.
MethodImplOptions
Defines the details of how a method is implemented.
Stores all the data needed to serialize or deserialize an object. This class cannot be inherited.
WeakReference(object target, bool trackResurrection)
Initializes a new instance of the T:System.WeakReference class, referencing the specified object and ...
Allows an object to control its own serialization and deserialization.
virtual void GetObjectData(SerializationInfo info, StreamingContext context)
Populates a T:System.Runtime.Serialization.SerializationInfo object with all the data needed to seria...
Specifies that the class can be serialized.
SecurityPermissionFlag
Specifies access flags for the security permission object.
virtual object Target
Gets or sets the object (the target) referenced by the current T:System.WeakReference object.