Add a tag resolution rule that is invoked when regex matches
the Scalar a Scalar node.
The tag is resolved to tag and decode is
invoked when actual value of type T is extracted from
the node text.
protected void AddScalarRule<T>(string tag, string regex, Func<Match, T> decode, Func<T, string>? encode)
The tag.
The regex.
The decode function.
The encode function.
BeginUpdate(); // to avoid invoking slow internal calculation method many times.
Add( ... );
Add( ... );
Add( ... );
Add( ... );
EndUpdate(); // automaticall invoke internal calculation method