<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>StegLog - utility</title>
    <link>http://blog.stegnar.com/</link>
    <description>Reflections on Software Development</description>
    <language>en-us</language>
    <copyright>Peter Stegnar</copyright>
    <lastBuildDate>Tue, 06 Oct 2009 10:55:30 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.3.9074.18820</generator>
    <managingEditor>peter@stegnar.com</managingEditor>
    <webMaster>peter@stegnar.com</webMaster>
    <item>
      <trackback:ping>http://blog.stegnar.com/Trackback.aspx?guid=23f45391-03bd-4758-b3e7-dd0ad46d0522</trackback:ping>
      <pingback:server>http://blog.stegnar.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.stegnar.com/PermaLink,guid,23f45391-03bd-4758-b3e7-dd0ad46d0522.aspx</pingback:target>
      <dc:creator>Peter Stegnar</dc:creator>
      <wfw:comment>http://blog.stegnar.com/CommentView,guid,23f45391-03bd-4758-b3e7-dd0ad46d0522.aspx</wfw:comment>
      <wfw:commentRss>http://blog.stegnar.com/SyndicationService.asmx/GetEntryCommentsRss?guid=23f45391-03bd-4758-b3e7-dd0ad46d0522</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">Do you like to have a neat and transparent
code base? One of the foundations of this in .NET are regions (#region ...). A smart
usage of regions significantly increase readability of the code base, but it can also
diminished it if it is misused (typically example would be heavy region usage in methods).<br /><br />
I have find out the following class region structure really neat:<br /><img src="http://blog.stegnar.com/content/binary/regionClassStucture.png" border="0" /><br />
But there is the problem. Maintenance of this structure. But there exists a great
tool to this instead of you - Regionerate.<br /><br />
Regionerate is an automatic layout enforcement tool for the C# programming language
as it also stated on the <a href="http://www.rauchy.net/regionerate/">tool's homepage.</a> This
tool is Add-in to Visual studio. It is really simple to use, just hit a keyboard shortcut
"Ctrl+R" and the tool will do the rest or right click on the code edit panel:<br /><img src="http://blog.stegnar.com/content/binary/RightClickRegionate.png" border="0" /><br /><br />
Code became instantly Regionerated. But question arise. In what way code became regionerated?
What are the names of the regions which members go into which region? Well there this
utility really shines. <b>You can totally customize it</b>. I will blog about this
in another post.<br /><br />
Regions in the upper picture were created with Regionerate tool. Did you notice the
number of members in the end of the name of each region? Nice.<br /><br />
Out of the box region structure really did no fit me, so I customize it. You can find
the customization file at the end of this blog post.<br /><br />
You can import customization file easily into the tool, just click "Regionerate this"
and then "Settings" and just select the proper XML customization file. Tool have some
problems with updating or changing customization file, sometimes change is not instantaneous.<br /><br />
It would be nice if you post your favorite region structure in comments.<br />
 <br /><a href="http://blog.stegnar.com/content/binary/CustomCodeLayout.xml">CustomCodeLayout.xml
(2.11 KB)</a><img width="0" height="0" src="http://blog.stegnar.com/aggbug.ashx?id=23f45391-03bd-4758-b3e7-dd0ad46d0522" /></body>
      <title>C# Regions - Regionerate</title>
      <guid isPermaLink="false">http://blog.stegnar.com/PermaLink,guid,23f45391-03bd-4758-b3e7-dd0ad46d0522.aspx</guid>
      <link>http://blog.stegnar.com/2009/10/06/CRegionsRegionerate.aspx</link>
      <pubDate>Tue, 06 Oct 2009 10:55:30 GMT</pubDate>
      <description>Do you like to have a neat and transparent code base? One of the foundations of this in .NET are regions (#region ...). A smart usage of regions significantly increase readability of the code base, but it can also diminished it if it is misused (typically example would be heavy region usage in methods).&lt;br&gt;
&lt;br&gt;
I have find out the following class region structure really neat:&lt;br&gt;
&lt;img src="http://blog.stegnar.com/content/binary/regionClassStucture.png" border="0"&gt;
&lt;br&gt;
But there is the problem. Maintenance of this structure. But there exists a great
tool to this instead of you - Regionerate.&lt;br&gt;
&lt;br&gt;
Regionerate is an automatic layout enforcement tool for the C# programming language
as it also stated on the &lt;a href="http://www.rauchy.net/regionerate/"&gt;tool's homepage.&lt;/a&gt; This
tool is Add-in to Visual studio. It is really simple to use, just hit a keyboard shortcut
"Ctrl+R" and the tool will do the rest or right click on the code edit panel:&lt;br&gt;
&lt;img src="http://blog.stegnar.com/content/binary/RightClickRegionate.png" border="0"&gt;
&lt;br&gt;
&lt;br&gt;
Code became instantly Regionerated. But question arise. In what way code became regionerated?
What are the names of the regions which members go into which region? Well there this
utility really shines. &lt;b&gt;You can totally customize it&lt;/b&gt;. I will blog about this
in another post.&lt;br&gt;
&lt;br&gt;
Regions in the upper picture were created with Regionerate tool. Did you notice the
number of members in the end of the name of each region? Nice.&lt;br&gt;
&lt;br&gt;
Out of the box region structure really did no fit me, so I customize it. You can find
the customization file at the end of this blog post.&lt;br&gt;
&lt;br&gt;
You can import customization file easily into the tool, just click "Regionerate this"
and then "Settings" and just select the proper XML customization file. Tool have some
problems with updating or changing customization file, sometimes change is not instantaneous.&lt;br&gt;
&lt;br&gt;
It would be nice if you post your favorite region structure in comments.&lt;br&gt;
&amp;nbsp;&lt;br&gt;
&lt;a href="http://blog.stegnar.com/content/binary/CustomCodeLayout.xml"&gt;CustomCodeLayout.xml
(2.11 KB)&lt;/a&gt;&lt;img width="0" height="0" src="http://blog.stegnar.com/aggbug.ashx?id=23f45391-03bd-4758-b3e7-dd0ad46d0522" /&gt;</description>
      <comments>http://blog.stegnar.com/CommentView,guid,23f45391-03bd-4758-b3e7-dd0ad46d0522.aspx</comments>
      <category>C#</category>
      <category>utility</category>
    </item>
  </channel>
</rss>