Table of Contents

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

TemplateArguments

Named

Gets the named values. The names are case-insensitive.

public IReadOnlyDictionary<string, object?> Named { get; }

Property Value

IReadOnlyDictionary<string, object>

Positional

Gets the positional values in the order, in which they were added.

public IReadOnlyList<object?> Positional { get; }

Property Value

IReadOnlyList<object>

Methods

AddNamed(string, object?)

Adds a named value, replacing an earlier value with the same name.

public TemplateArguments AddNamed(string name, object? value)

Parameters

name string

The name of the placeholder.

value object

The value.

Returns

TemplateArguments

This instance.

AddPositional(object?)

Adds a positional value.

public TemplateArguments AddPositional(object? value)

Parameters

value object

The value.

Returns

TemplateArguments

This instance.