Skip to content

PairsAttribute

namespace Griff.Scenes;
public sealed class PairsAttribute : RowsAttribute

A list of names, each with a value: “Sword: 30” a line (or “Sword = 30”, Separator), as a dictionary holds them. The Inspector lists them a row each, the name and its value (a number to drag or a color to pick when they all are) side by side, to set, add, remove and reorder; a name given twice is flagged. It’s what a list of strings with no editor of its own gets when every line reads so (see GenericFields); mark one with it ([Pairs]) to say so while it’s empty.

public override IReadOnlyList<RowColumn> Columns { get; }
public override string Example { get; }
public string Key { get; init; }

What the names are called, over their column: “Name” unless it says.

public override string Noun { get; }
public string Separator { get; init; }

What’s between a name and its value: “:” (“Sword: 30”) unless it says (“=” for “Sword = 30”).

protected override char[] Separators { get; }
public string Value { get; init; }

What the values are called, over their column: “Value” unless it says.

public CellKind Values { get; init; }

What the values are: Text unless it says (Number, Color).

public override string Describe()
public override string? Problem(Component component, object? value)
public override IReadOnlyList<string>? Read(string row)
public override string Write(IReadOnlyList<string> cells)