all groups > dotnet windows forms designtime > february 2005 >
You're in the

dotnet windows forms designtime

group:

CODEDOM - LINE


CODEDOM - LINE João Santa Bárbara
2/1/2005 10:48:28 AM
dotnet windows forms designtime:
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

Re: CODEDOM - LINE Lionel LASKE
2/1/2005 1:49:47 PM

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.


"João Santa Bárbara" <joaosb@i24portugal.com> a écrit dans le message de
news: OA2mUuECFHA.3940@TK2MSFTNGP09.phx.gbl...
[quoted text, click to view]

AddThis Social Bookmark Button