Commit Graph

9 Commits

Author SHA1 Message Date
Travis Parks 20dcfc059d Fire event whenever a placeholder is found.
It could be useful to track which placeholders were found when parsing
the template. This event will allow keys to be mapped to different keys,
and support changing alignment and formatting.
2013-04-24 08:58:19 -04:00
Travis Parks a6c7933bab Provide more details when keys not found.
A request was made to provide the original key as well as the member
that was not found. In compound keys {{Customer.Address.ZipCode}}, any
of the names could be invalid, but knowing the fully-qualified name is
useful for error handling.

I also detected a bug where the code wasn't handling the case that a
sub-key didn't exist. This needs to be handled using the KeyNotFound
event.
2013-04-19 08:56:21 -04:00
Travis Parks ac09c8fc38 Support Missing Key Handlers
A request was made to allow missing keys to be handled in a custom
manner. I created an event that can be registered with the Generator
instances.

I also fixed a deployment issue causing debug versions of the library to
be packaged and released to NuGet. This should boost performance
considerably.
2013-04-18 19:27:09 -04:00
Travis Parks fe54d9522b Default the Scope and Writer for Nested Contexts
I forgot to default the KeyScope and TextWriter to the parent tag's
scope and writer if they are not provided.
2013-01-16 16:06:35 -05:00
Travis Parks 790f856b44 Optimized text generation.
The way the code was implemented before, each block of text was
generating a string which was then being added to a StringBuilder. This
only improved performance within a block itself. Needing to then copy
the results of that builder into the parent tag's builder was wasteful.
Now, a single TextWriter is used for all tags. If a block needs to be
processed after-the-fact, the tag can indicate that it wants to provide
a new text writer and that it wants to consolidate the text.
2013-01-16 15:10:25 -05:00
Travis Parks f848d63d9a Handle Unknown Tags
I added code to detect unknown tags and throw an exception. I also
provided a default implementation so tags are in the global scope by
default.
2013-01-12 20:22:31 -05:00
Travis Parks 0b84ca8877 Made progress implementing the object model, including all of the built-in tags. 2013-01-09 21:17:45 -05:00
Travis Parks f8628aaf86 Implement custom tags.
This is the first step towards supporting custom tags. There are
wrinkles I need to work out, since I'm not 100% sure what the finished
code will look like.
2013-01-08 21:33:53 -05:00
Travis Parks 827faa5d6e Initial Commit
This is the code almost verbatim from the NList project. This project is
due for a major overhaul, but I don't know the order I will be breaking
out NList in the upcoming weeks.
2013-01-01 21:01:34 -05:00