Class TemplateArguments
- Namespace
- Tlumach.Templating
- Assembly
- Tlumach.dll
The values, which a template passes to one call of TemplateTranslator for the placeholders of a translation.
Positional values fill indexed placeholders ({0}, {1}) and, by position, named placeholders without a named value. Named values fill named placeholders; their names are case-insensitive.
public sealed class TemplateArguments
- Inheritance
-
TemplateArguments
- Inherited Members
Constructors
TemplateArguments()
Initializes a new instance of the TemplateArguments class without values.
public TemplateArguments()
Properties
Empty
Gets a shared instance without values, which cannot be changed.
public static TemplateArguments Empty { get; }
Property Value
Named
Gets the named values. The names are case-insensitive.
public IReadOnlyDictionary<string, object?> Named { get; }
Property Value
Positional
Gets the positional values in the order, in which they were added.
public IReadOnlyList<object?> Positional { get; }
Property Value
Methods
AddNamed(string, object?)
Adds a named value, replacing an earlier value with the same name.
public TemplateArguments AddNamed(string name, object? value)
Parameters
Returns
- TemplateArguments
This instance.
AddPositional(object?)
Adds a positional value.
public TemplateArguments AddPositional(object? value)
Parameters
valueobjectThe value.
Returns
- TemplateArguments
This instance.