Class WeakFunc<T, TResult>
Class WeakFunc. Implements the WeakFunc<TResult> Implements the IExecuteWithObjectAndResult
Implements
Inherited Members
Namespace: ISynergy.Framework.Core.Events
Assembly: ISynergy.Framework.Core.dll
Syntax
public class WeakFunc<T, TResult> : WeakFunc<TResult>, IExecuteWithObjectAndResult
Type Parameters
Name | Description |
---|---|
T | |
TResult | The type of the t result. |
Constructors
View SourceWeakFunc(Func<T, TResult>, Boolean)
Initializes a new instance of the WeakFunc<T, TResult> class.
Declaration
public WeakFunc(Func<T, TResult> func, bool keepTargetAlive = false)
Parameters
Type | Name | Description |
---|---|---|
Func<T, TResult> | func | The function. |
System.Boolean | keepTargetAlive | if set to |
WeakFunc(Object, Func<T, TResult>, Boolean)
Initializes a new instance of the WeakFunc<T, TResult> class.
Declaration
public WeakFunc(object target, Func<T, TResult> func, bool keepTargetAlive = false)
Parameters
Type | Name | Description |
---|---|---|
System.Object | target | The target. |
Func<T, TResult> | func | The function. |
System.Boolean | keepTargetAlive | if set to |
Properties
View SourceIsAlive
Gets a value indicating whether this instance is alive.
Declaration
public override bool IsAlive { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Overrides
ISynergy.Framework.Core.Events.WeakFunc<TResult>.IsAlive
View Source
MethodName
Gets the name of the method.
Declaration
public override string MethodName { get; }
Property Value
Type | Description |
---|---|
System.String | The name of the method. |
Overrides
ISynergy.Framework.Core.Events.WeakFunc<TResult>.MethodName
Methods
View SourceExecute()
Executes this instance.
Declaration
public TResult Execute()
Returns
Type | Description |
---|---|
TResult | TResult. |
Execute(T)
Executes the specified parameter.
Declaration
public TResult Execute(T parameter)
Parameters
Type | Name | Description |
---|---|---|
T | parameter | The parameter. |
Returns
Type | Description |
---|---|
TResult | TResult. |
ExecuteWithObject(Object)
Executes a Func and returns the result.
Declaration
public object ExecuteWithObject(object parameter)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parameter | A parameter passed as an object, to be casted to the appropriate type. |
Returns
Type | Description |
---|---|
System.Object | The result of the operation. |
MarkForDeletion()
Marks for deletion.
Declaration
public void MarkForDeletion()
Implements
Extension Methods
CollectionExtensions.FromHierarchy<TSource>(TSource, Func<TSource, TSource>, Func<TSource, Boolean>)
See Also
WeakFunc<TResult>