Empeld
Empeld plugin documentation.
pluginbase.Helpers.WeakReferenceExt< T > Class Template Reference

An extended, generic, WeakReference type. Not named WeakReference to avoid conflict with the MS .Net 4.5 generic weak reference More...

Inheritance diagram for pluginbase.Helpers.WeakReferenceExt< T >:

Public Member Functions

 WeakReferenceExt (T target)
 Initializes a new instance of the class. More...
 
bool TryGetTarget (out T target)
 Try to get the target. Returns false if it does not exist More...
 

Static Public Member Functions

static operator WeakReferenceExt< T > (T obj)
 
static implicit operator T (WeakReferenceExt< T > input)
 

Properties

new T Target [get]
 Gets the target. More...
 

Detailed Description

An extended, generic, WeakReference type. Not named WeakReference to avoid conflict with the MS .Net 4.5 generic weak reference

Type Constraints
T :class 

Constructor & Destructor Documentation

◆ WeakReferenceExt()

Initializes a new instance of the class.

Parameters
targetTarget.
17  :base(target, false)
18  {}

Member Function Documentation

◆ operator T()

static implicit pluginbase.Helpers.WeakReferenceExt< T >.operator T ( WeakReferenceExt< T >  input)
static
46  {
47  return input.Target;
48  }

◆ operator WeakReferenceExt< T >()

static pluginbase.Helpers.WeakReferenceExt< T >.operator WeakReferenceExt< T > ( obj)
explicitstatic
41  {
42  return new WeakReferenceExt<T>(obj);
43  }

◆ TryGetTarget()

bool pluginbase.Helpers.WeakReferenceExt< T >.TryGetTarget ( out T  target)

Try to get the target. Returns false if it does not exist

Returns
true, if get target was successful, false otherwise.
Parameters
targetTarget.
35  {
36  target = this.Target;
37  return target != null;
38  }
new T Target
Gets the target.
Definition: WeakReferenceExt.cs:25

Property Documentation

◆ Target

new T pluginbase.Helpers.WeakReferenceExt< T >.Target
get

Gets the target.

The target.


The documentation for this class was generated from the following file: