When using a WeakReference, how can we be sure than the target is not collected between the .IsAlive and .Target calls?
For example:
if (myWeakReference.IsAlive)
{
// How can we be sure the object is still alive while here?
((MyType)myWeakReference.Target).Foo();
}