Retrieve C# language keywords at runtime

T

Troy

Hi,

I working on a tool, that autogenerate some code base on custom inputs. I
have a smaller problem that som custom names are colliding with keywords of
the C# language. So my question is: Are there any method/property within the
framework the return a list of all keywords (for,is,if etc..) so i can
identify those names?

I can ofcause hardcode them, but new words are added in new framwork
versions like; var and dynamic, so the best solution is get them at
runtime....

TIA
 
G

Gregory A. Beamer

Based on your needs, I would use the second link Patrice advised
(CreateEscapedIdentifier), as it will simply escape keywords.

--
Gregory A. Beamer
MVP: MCP: +I, SE, SD, DBA

Blog:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think Outside the Box! |
********************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top