- Fixed issue with parsing named formatter options (#45)
- Minor changes to the Extensions API:
- Added fields to
ISelectorInfo
- Made
Text
obsolete in favor ofRawText
.
- Added
TemplateFormatter
. Allows you to register named templates, to be used within other templates.
Note: the TemplateFormatter extension is not a default extension, and must be added manually.
- Added "Nested Scopes" feature. This allows a nested template to
easily access outer scopes, without tricky workarounds.
For example: in"{Person: {Address: {City} {FirstName} } }"
,{City}
will come fromAddress
, but{FirstName}
will come fromPerson
.
This will work especially well with conditional formatting!
- Massive improvements to the Extension API. Code is cleaner and easier to use.
- Breaking changes: Any custom Extensions will need to be updated to match the new API.
Long story short, instead of 5 parameters passed toIFormatter.EvaluateFormat
, it now just gets a singleFormatterInfo
argument that contains all parameters. - Added the "choose" formatter, to eventually replace the ConditionalFormatter.
Hopefully it's self explanatory with these usage examples:
"{0:choose(1|2|3):one|two|three|default}"
works like a switch statement"{0:choose(null):nothing|{something}}"
can do null checking"{Gender:choose(Male|Female):his|her}"
works great with Enums
- Added "Named Formatters", which allows you to use a
specific formatter by specifying its name.
For example, "{0:plural: ___ }" will use the Plural formatter, and "{0:default: ___ }" will use the default formatter. - Added "Formatter Options", which allows you to specify options
for a named formatter. This will be used in the near future.
For example, "{0:name(options): ___ }"
- Added .NET v3.5 and .NET v4.0 builds
- Added "releases" folder to hold official releases
- Added
UseAlternativeBraces
method, so that templates can use alternative characters - Added
SmartFormatter.GetFormatterExtension
andGetSourceExtension
methods, which can be used to configure extensions - Added
DefaultTwoLetterISOLanguageName
properties to theTimeSpanFormatter
andPluralLocalizationFormatter
- Fixed
AddExtensions
to insert new extensions before existing ones (otherwise, it's pretty useless) (#17)
Converted from "CustomFormat" (VB.NET)