CodeDom and pasing csharp code

  • Thread starter Thread starter skneife
  • Start date Start date
S

skneife

I am looking for the way of using CodeDom for parsing C# code.
My needs is to extract for a source files all methods.
Does anyone have a sample ?

Sam
 
I am looking for the way of using CodeDom for parsing C# code.
My needs is to extract for a source files all methods.
Does anyone have a sample ?

I can't help you with CodeDom (sorry) but if you're trying to inspect the
files in a VS solution (on a machine with VS installed presumably) then you
may want to consider "EnvDTE.ProjectItem.FileCodeModel.CodeElements". This
(easily) allows you to iterate all code elements in a file including its
methods. Consider that you may need to do this on a cleanly compiled project
however. Otherwise a given source file might contain errors of course.
 
Back
Top