Skip to content

Change settings when using method Smart.Format(...) #336

Answered by axunonb
mg72266 asked this question in Q&A
Discussion options

You must be logged in to vote

This does not work:

Smart.Default.Settings.Parser.AddCustomSelectorChars(" $".ToCharArray());

As pointed out in the Wiki, changes to settings after the instances are created won't be processed. But this is what happens when calling Smart.Default: it creates default SmartSettings.

This works:

Console.WriteLine(Smart.CreateDefaultSmartFormat(Smart.Default.Settings).Format(format, templateData));

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by axunonb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #334 on March 24, 2023 17:44.