Class WeakFunc<TResult>
Class WeakFunc.
Namespace: ISynergy.Framework.Core.Events
Assembly: ISynergy.Framework.Core.dll
Syntax
public class WeakFunc<TResult> : object
Type Parameters
Name | Description |
---|---|
TResult | The type of the t result. |
Constructors
View SourceWeakFunc()
Initializes a new instance of the WeakFunc<TResult> class.
Declaration
protected WeakFunc()
WeakFunc(Func<TResult>, Boolean)
Initializes a new instance of the WeakFunc<TResult> class.
Declaration
public WeakFunc(Func<TResult> func, bool keepTargetAlive = false)
Parameters
Type | Name | Description |
---|---|---|
Func<TResult> | func | The function. |
System.Boolean | keepTargetAlive | if set to |
WeakFunc(Object, Func<TResult>, Boolean)
Initializes a new instance of the WeakFunc<TResult> class.
Declaration
public WeakFunc(object target, Func<TResult> func, bool keepTargetAlive = false)
Parameters
Type | Name | Description |
---|---|---|
System.Object | target | The target. |
Func<TResult> | func | The function. |
System.Boolean | keepTargetAlive | if set to |
Properties
View SourceFuncReference
Gets or sets the function reference.
Declaration
protected WeakReference FuncReference { get; set; }
Property Value
Type | Description |
---|---|
WeakReference | The function reference. |
FuncTarget
Gets the function target.
Declaration
protected object FuncTarget { get; }
Property Value
Type | Description |
---|---|
System.Object | The function target. |
IsAlive
Gets a value indicating whether this instance is alive.
Declaration
public virtual bool IsAlive { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
IsStatic
Gets a value indicating whether this instance is static.
Declaration
public bool IsStatic { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
LiveReference
Gets or sets the live reference.
Declaration
protected object LiveReference { get; set; }
Property Value
Type | Description |
---|---|
System.Object | The live reference. |
Method
Gets or sets the method.
Declaration
protected MethodInfo Method { get; set; }
Property Value
Type | Description |
---|---|
MethodInfo | The method. |
MethodName
Gets the name of the method.
Declaration
public virtual string MethodName { get; }
Property Value
Type | Description |
---|---|
System.String | The name of the method. |
Reference
Gets or sets the reference.
Declaration
protected WeakReference Reference { get; set; }
Property Value
Type | Description |
---|---|
WeakReference | The reference. |
Target
Gets the target.
Declaration
public object Target { get; }
Property Value
Type | Description |
---|---|
System.Object | The target. |
Methods
View SourceExecute()
Executes this instance.
Declaration
public TResult Execute()
Returns
Type | Description |
---|---|
TResult | TResult. |
MarkForDeletion()
Marks for deletion.
Declaration
public void MarkForDeletion()