Files
mirror-processhacker/trunk/ProcessHacker.Common/WeakReference.cs
T
wj32 ce24964325 major refactoring - utility functions are now in a separate library and SymbolProvider is now in ProcessHacker.Native
git-svn-id: svn://svn.code.sf.net/p/processhacker/code@1355 21ef857c-d57f-4fe0-8362-d861dc6d29cd
2009-05-31 11:05:47 +00:00

37 lines
809 B
C#

using System;
using System.Collections.Generic;
using System.Text;
namespace ProcessHacker.Common
{
public class WeakReference<T>
where T : class
{
private WeakReference _weakReference;
public WeakReference(T obj)
: this(obj, false)
{ }
public WeakReference(T obj, bool trackResurrection)
{
_weakReference = new WeakReference(obj, trackResurrection);
}
public bool Alive
{
get { return _weakReference.IsAlive; }
}
public bool TrackResurrection
{
get { return _weakReference.TrackResurrection; }
}
public T Target
{
get { return _weakReference.Target as T; }
}
}
}