CodeDom using statement

  • Thread starter Thread starter pascal_pare
  • Start date Start date
P

pascal_pare

Hi,

Is there a way to declare a using statement with the CodeDom?

Something like:

using (obj = new Object())
{
obj.DoSomething;
}


Thanks,
Pascal Pare
 
Pascal,

Probably not, because this isn't something that is guaranteed to exist
across languages (the using statement compiles to a try/finally statement
ultimately). You wil have to create the full expansion that the compiler
does.

Hope this helps.
 
Hi,
I have a quesy on code dom. I managed to add attributes to methos using
code dom but it works like this [WebMethod()] but i dont need a "()" to
appear I just need [WebMethod] .
Any idea how to do that??
Thanks,
Ravi

Nicholas Paldino said:
Pascal,

Probably not, because this isn't something that is guaranteed to exist
across languages (the using statement compiles to a try/finally statement
ultimately). You wil have to create the full expansion that the compiler
does.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Hi,

Is there a way to declare a using statement with the CodeDom?

Something like:

using (obj = new Object())
{
obj.DoSomething;
}


Thanks,
Pascal Pare
 
Back
Top