[stringtemplate-interest] antlr.org contact
Terence Parr
parrt at cs.usfca.edu
Sat Aug 13 09:59:21 PDT 2011
OH. Sam, care to comment?
Ter
On Aug 12, 2011, at 11:52 PM, Robert Nash wrote:
> Hi Ter,
>
> It's new .net 4.0 stuff after sending the first email I have dug into your
> code and figured out how to achieve what I was after. I've included some
> code for your reference.
>
>
> public class ExpandoModelAdaptor : IModelAdaptor
> {
> public object GetProperty(Interpreter interpreter, TemplateFrame
> frame, object obj, object property, string propertyName)
> {
> if (obj is ExpandoObject)
> {
> IDictionary<string,object> dictionary= (obj) as
> IDictionary<string, object>;
>
> if (dictionary.ContainsKey(propertyName))
> return dictionary[propertyName];
>
> }
> return string.Empty;
> }
> }
>
> Regards,
> Rob
>
>
>
> -----Original Message-----
> From: Terence Parr [mailto:parrt at cs.usfca.edu]
> Sent: 12 August 2011 20:19
> To: robert.nash at 4-roads.com
> Cc: stringtemplate-interest List
> Subject: Re: antlr.org contact
>
> hiya. what's a dynamic object?
> Ter
> On Aug 12, 2011, at 10:55 AM, robert.nash at 4-roads.com wrote:
>
>> rob nash wrote:
>>
>> I'm playing around with StringTemplate in .net I like it overall. I was
> hoping that I would be able to use dynamic objects for the template
> parameters, however it appears not to work any suggestions?
>>
>> Regards,
>> Rob
>>
>>
>
>
>
More information about the stringtemplate-interest
mailing list