Class FuncFactory<TTuple, TResult>
- Namespace
- Cuemon
- Assembly
- Cuemon.Core.dll
Provides an easy way of invoking an System.Func<TResult> function delegate regardless of the amount of parameters provided.
public sealed class FuncFactory<TTuple, TResult> : TemplateFactory<TTuple> where TTuple : Template
Type Parameters
TTuple
The type of the n-tuple representation of a Template.
TResult
The type of the return value of the function delegate Cuemon.FuncFactory`2.Method.
- Inheritance
-
ObjectTemplateFactory<TTuple>FuncFactory<TTuple, TResult>
- Inherited Members
Constructors
FuncFactory(Func<TTuple, TResult>, TTuple)
Initializes a new instance of the FuncFactory<TTuple, TResult> class.
public FuncFactory(Func<TTuple, TResult> method, TTuple tuple)
Parameters
method
Func<TTuple, TResult>The function delegate to invoke.
tuple
TTupleThe n-tuple argument of
method
.
Methods
Clone()
Creates a shallow copy of the current FuncFactory<TTuple, TResult> object.
public override TemplateFactory<TTuple> Clone()
Returns
- TemplateFactory<TTuple>
A new FuncFactory<TTuple, TResult> that is a copy of this instance.
Remarks
When thread safety is required this is the method to invoke.
ExecuteMethod()
Executes the function delegate associated with this instance.
public TResult ExecuteMethod()
Returns
- TResult
The result of the the function delegate associated with this instance.