コード例 #1
0
ファイル: _weakref.cs プロジェクト: weimingtom/IronPythonMod
            public override bool Equals(object obj)
            {
                if ((object)this == obj)
                {
                    return(true);
                }

                bool fResult           = false;
                PythonWeakReference wr = obj as PythonWeakReference;

                if (wr != null)
                {
                    object ourTarget = target.Target;
                    object itsTarget = wr.target.Target;

                    GC.KeepAlive(this);
                    GC.KeepAlive(wr);
                    if (ourTarget != null && itsTarget != null)
                    {
                        fResult = Ops.IsTrue(RefEquals(ourTarget, itsTarget));
                    }
                }
                GC.KeepAlive(this);
                return(fResult);
            }
コード例 #2
0
ファイル: _weakref.cs プロジェクト: weimingtom/IronPythonMod
 public static List GetWeakRefs(object @object)
 {
     return(PythonWeakReference.GetWeakRefs(@object));
 }
コード例 #3
0
ファイル: _weakref.cs プロジェクト: weimingtom/IronPythonMod
 public static int GetWeakRefCount(object @object)
 {
     return(PythonWeakReference.GetWeakRefCount(@object));
 }