Retrieve C# language keywords at runtime

  • Thread starter Thread starter Troy
  • Start date Start date
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
 
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! |
********************************************
 
Back
Top