< Dice | FunctionRegistry
Difference between revisions of "Dice/FunctionRegistry/Remove"
From DiceRoller Documentation
(Created page with "{{APIdoc|FunctionRegistry.Remove Method (String, FunctionScope)}} Removes the function with the given name and scope. {{ns}} == Syntax == <syntaxhighlight lang="C#"> public...") |
|||
Line 27: | Line 27: | ||
| ArgumentNullException || ''name'' is {{cs|null}}. | | ArgumentNullException || ''name'' is {{cs|null}}. | ||
|- | |- | ||
− | | ArgumentException || ''name'' refers to a reserved function name. | + | | ArgumentException || ''name'' refers to a reserved function name ''-or-'' you passed FunctionScope.All or FunctionScope.Roll as the scope. |
|} | |} | ||
== Remarks == | == Remarks == | ||
Reserved function names (dropLowest, reroll, success, critical, etc.) are not actually implemented as functions, and cannot therefore be removed. Actual built-in functions (max, min, round, if, etc.) can be removed, however. If a function with a given ''name'' and ''scope'' does not exist, no error is thrown. | Reserved function names (dropLowest, reroll, success, critical, etc.) are not actually implemented as functions, and cannot therefore be removed. Actual built-in functions (max, min, round, if, etc.) can be removed, however. If a function with a given ''name'' and ''scope'' does not exist, no error is thrown. |
Latest revision as of 23:07, 14 August 2017
Removes the function with the given name and scope.
- Namespace: Dice
- Assembly: DiceRoller (in DiceRoller.dll)
Syntax
public void Remove(
string name,
FunctionScope scope
)
Parameters
- name
- Type: System.String
- Name of the function to remove, case-insensitive.
- scope
- Type: Dice.FunctionScope
- Scope of the function to remove the name from.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | name is null .
|
ArgumentException | name refers to a reserved function name -or- you passed FunctionScope.All or FunctionScope.Roll as the scope. |
Remarks
Reserved function names (dropLowest, reroll, success, critical, etc.) are not actually implemented as functions, and cannot therefore be removed. Actual built-in functions (max, min, round, if, etc.) can be removed, however. If a function with a given name and scope does not exist, no error is thrown.