예제 #1
0
        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);
        }
예제 #2
0
 public WeakReference(object target, bool trackResurrection)
 {
     this.m_IsLongReference = trackResurrection;
     this.m_handle          = GCHandle.InternalAlloc(target, trackResurrection ? GCHandleType.WeakTrackResurrection : GCHandleType.Weak);
 }