예제 #1
0
            public object this[int index] {
                get {
                    WeakRefObject weakRef = InnerList[index] as WeakRefObject;

                    if ((weakRef != null) && (weakRef.IsAlive))
                    {
                        return(weakRef.Target);
                    }

                    return(null);
                }
                set {
                    InnerList[index] = CreateWeakRefObject(value);
                }
            }
예제 #2
0
파일: ClientUtils.cs 프로젝트: radtek/Print
 public object this[int index]
 {
     get
     {
         WeakRefObject obj2 = this.InnerList[index] as WeakRefObject;
         if ((obj2 != null) && obj2.IsAlive)
         {
             return(obj2.Target);
         }
         return(null);
     }
     set
     {
         this.InnerList[index] = this.CreateWeakRefObject(value);
     }
 }
예제 #3
0
            public override bool Equals(object obj)
            {
                WeakRefObject weakRefObject = obj as WeakRefObject;

                if (weakRefObject == this)
                {
                    return(true);
                }
                if (weakRefObject == null)
                {
                    return(false);
                }
                if (weakRefObject.Target != Target && (Target == null || !Target.Equals(weakRefObject.Target)))
                {
                    return(false);
                }
                return(true);
            }
예제 #4
0
                public override bool Equals(object obj)
                {
                    WeakRefObject other = obj as WeakRefObject;

                    if (other == this)
                    {
                        return(true);
                    }

                    if (other == null)
                    {
                        return(false);
                    }

                    if (other.Target != this.Target)
                    {
                        if (this.Target == null || !this.Target.Equals(other.Target))
                        {
                            return(false);
                        }
                    }

                    return(true);
                }