CODEDOM - LINE

  • Thread starter João Santa Bárbara
  • Start date
J

João Santa Bárbara

Hi all
i have a CodeStatementCollection, and i want to see what's in each line
ex:
dim x as object = new XXXobject
x.myproperty=100

and so one ..

can someone help me ???
thks
JSB
 
L

Lionel LASKE

I'm not sure to understand your need.
Do you want the VB.NET code for your CodeStatementCollection ?
In this case, you must iterate on each statement and call
"ICodeGenerator.GenerateCodeFromStatement".
Something like this:

ICodeGenerator VBCodeProvider cscProvider = new VBCodeProvider();
generator = cscProvider.CreateGenerator(myStreamWriter);
CodeGeneratorOptions cop = new CodeGeneratorOptions();

foreach (stmt in myCodeStatementCollection )
generator.GenerateCodeFromStatement(stmt, myStreamWriter, cop);

You need a StreamWriter to do that.

Lionel.
 
J

joeycalisay

you can deduce from the type of CodeStatement and its Left and Right side
objects or if you want, you can try to browse for the code for the
CodeGenerator classes of .NET
 

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