#region through CODEDOM

  • Thread starter Thread starter Osvaldo Bisignano
  • Start date Start date
Hi Osvaldo,

I don't think you can, since #region might be language specific.

--
Miha Markic - RightHand .NET consulting & development
miha at rthand com
www.rhand.com

I want to generate #region #endregion statements through codedom.
 
that's why CodeSnippets exists. The thing is I don't know where to insert an CodeSnippetStatement/Expression 'cause they must be added to a collection like when you do

SomeMethod.Statements.Add(MyCodeSnippetStatement)

since #region statements are floating "freely" in the code, and do not belong to any structure like a class or something else, i dont know where to put it.

I thought the namespace or the compilaton unit would have a "CodeLines" collection but couldn't find it. By the way... is LinePragma something I can use. Google return just 5 pages about it.

Thanks
 
and #region is not languaje specific Miha, it exists in both VB and C#,
though it's implemented in different ways.

//C# sample
#region Description
...
#endregion

'VB Sample
#region "Description"
...
#end region
 
Just because these two languages support the construct does not mean that it
is not language specific.

There are lots of languages out there (Perl, COBAL, Pascal, VB, C#, C++,
Java, etc.) Not all of these languages necessarily support defining of
regions.
 
Peter said:
There are lots of languages out there (Perl, COBAL, Pascal, VB, C#,
C++, Java, etc.) Not all of these languages necessarily support
defining of regions.

Isn't #region IDE-specific?

--
There are 10 kinds of people. Those who understand binary and those who
don't.

http://code.acadx.com
(Pull the pin to reply)
 
yeah, that's a good point. I get the idea.
Anyways, CodeSnippet(Statement/Expression) are CodeDom classes designed to
achieve these language specific features. Do you know of any way to generate
this sentence?

Thanks
 
Hi Frank,


Frank Oquendo said:
Isn't #region IDE-specific?

Not really. It is a part of source code thus the compiler has to deal with
it.
It is true that it is usefull only if IDE uses it though.
 
Back
Top