< Dice
Difference between revisions of "Dice/FunctionCallback"
From DiceRoller Documentation
(Created page with "{{APIdoc|FunctionCallback Delegate}} Encapsulates a method which executes function logic. {{ns}} == Syntax == <syntaxhighlight lang="C#"> public delegate void FunctionCallba...") |
(No difference)
|
Revision as of 20:22, 12 April 2017
Encapsulates a method which executes function logic.
- Namespace: Dice
- Assembly: DiceRoller (in DiceRoller.dll)
Syntax
public delegate void FunctionCallback(
FunctionContext context
)
Parameters
- context
- Type: Dice.FunctionContext
- Function context, to be filled in by the delegate.
Remarks
The FunctionCallback delegate is used alongside the DiceFunctionAttribute and FunctionRegistry.RegisterType, or with FunctionRegistry.RegisterFunction. The delegate can gain insight into the context of the function call by examining the passed-in context object, and it must also modify the context object's Value and Values. If no delegate in the chain modifies the context's Value or Values, an exception is thrown.