You can easily tweak the way Regionerate spaces your code.
Padding the First and Last Child
You can set the amount of new lines that will be added before the first child and after the last child of every region by setting the PadFirstChild and PadLastChild attributes on the CreateRegion element.
For example, this Code Layout snippet will place 2 new lines between the region's declaration and its members:
<CreateRegion Title="Fields" PadFirstChild="2" PadLastChild="2">
<PutFields/>
</CreateRegion>
Running this Code Layout on this piece of code:
1: class MyClass
2: {3: private string _myField;
4: }... will result in this:
1: public class MyClass
2: {3: #region Fields (1)
4: 5: 6: private int _myField;
7: 8: 9: #endregion Fields
10: }The default value for PadFirstChild and PadLastChild is 1, meaning that if you don't specify any other value, the items will be padded with a single line.
Separating Consecutive Children
You can also control the amount of new lines between two consecutive children. This can be done at the ForEach level and at the Put level by using the SeparatingLines attribute.
For example, this Code Layout snippet will put 2 separating lines between every two consecutive regions inside an interface:
<ForEach Type="Interface" SeparatingLines="2">
<CreateRegion Title="Properties">...</CreateRegion>
<CreateRegion Title="Events">...</CreateRegion>
<CreateRegion Title="Methods">...</CreateRegion>
</ForEach>
Labels: Code Layout, Code Layout Tricks, Documentation