protected WeakReference(SerializationInfo info, StreamingContext context) { if (info == null) { throw new ArgumentNullException("info"); } object obj2 = info.GetValue("TrackedObject", typeof(object)); this.m_IsLongReference = info.GetBoolean("TrackResurrection"); this.m_handle = GCHandle.InternalAlloc(obj2, this.m_IsLongReference ? GCHandleType.WeakTrackResurrection : GCHandleType.Weak); }
public WeakReference(object target, bool trackResurrection) { this.m_IsLongReference = trackResurrection; this.m_handle = GCHandle.InternalAlloc(target, trackResurrection ? GCHandleType.WeakTrackResurrection : GCHandleType.Weak); }