Regionerate Rocks!

September 15, 2009

I’ve just stumbled across Regionerate.  It’s a fantastic little tool that automatically applies regions to C# code.  For a code nazi like me this is invaluable and will likely spare me from RSI and lifetime of misery!

I also wrote a custom configuration file that matches my particular form of OCD (obsessive code disorder):

<?xml version="1.0" encoding="utf-16"?>
<CodeLayout xmlns="http://regionerate.net/schemas/0.7.0.0/CodeLayout.xsd">
  <ForEach Type="Class">
    <CreateRegion Title="Public Static Fields" PadFirstChild="0" PadLastChild="0" ShowCount="false" Style="Visible">
      <PutFields>
        <Where>
          <Static Equals="true"/>
          <Access Equals="Public" />
        </Where>
        <OrderBy>
          <Name />
        </OrderBy>
      </PutFields>
    </CreateRegion>
    <CreateRegion Title="Internal Static Fields" PadFirstChild="0" PadLastChild="0" ShowCount="false" Style="Visible">
      <PutFields>
        <Where>
          <Static Equals="true"/>
          <Access Equals="Internal" />
        </Where>
        <OrderBy>
          <Name />
        </OrderBy>
      </PutFields>
    </CreateRegion>
    <CreateRegion Title="Protected Static Fields" PadFirstChild="0" PadLastChild="0" ShowCount="false" Style="Visible">
      <PutFields>
        <Where>
          <Static Equals="true"/>
          <Access Equals="Protected" />
        </Where>
        <OrderBy>
          <Name />
        </OrderBy>
      </PutFields>
    </CreateRegion>
    <CreateRegion Title="Private Static Fields" PadFirstChild="0" PadLastChild="0" ShowCount="false" Style="Visible">
      <PutFields>
        <Where>
          <Static Equals="true"/>
          <Access Equals="Private" />
        </Where>
        <OrderBy>
          <Name />
        </OrderBy>
      </PutFields>
    </CreateRegion>
    <CreateRegion Title="Public Fields" PadFirstChild="0" PadLastChild="0" ShowCount="false" Style="Visible">
      <PutFields>
        <Where>
          <Static Equals="false"/>
          <Access Equals="Public" />
        </Where>
        <OrderBy>
          <Name />
        </OrderBy>
      </PutFields>
    </CreateRegion>
    <CreateRegion Title="Internal Fields" PadFirstChild="0" PadLastChild="0" ShowCount="false" Style="Visible">
      <PutFields>
        <Where>
          <Static Equals="false"/>
          <Access Equals="Internal" />
        </Where>
        <OrderBy>
          <Name />
        </OrderBy>
      </PutFields>
    </CreateRegion>
    <CreateRegion Title="Protected Fields" PadFirstChild="0" PadLastChild="0" ShowCount="false" Style="Visible">
      <PutFields>
        <Where>
          <Static Equals="false"/>
          <Access Equals="Protected" />
        </Where>
        <OrderBy>
          <Name />
        </OrderBy>
      </PutFields>
    </CreateRegion>
    <CreateRegion Title="Private Fields" PadFirstChild="0" PadLastChild="0" ShowCount="false" Style="Visible">
      <PutFields>
        <Where>
          <Static Equals="false"/>
          <Access Equals="Private" />
        </Where>
        <OrderBy>
          <Name />
        </OrderBy>
      </PutFields>
    </CreateRegion>
    <CreateRegion Title="Static Ctor" PadFirstChild="0" PadLastChild="0" ShowCount="false" Style="Visible">
      <PutMethods>
        <Where>
          <IsConstructor Equals="true" />
          <Static Equals="true"/>
        </Where>
        <OrderBy>
          <ParametersCount />
        </OrderBy>
      </PutMethods>
    </CreateRegion>
    <CreateRegion Title="Ctor" PadFirstChild="0" PadLastChild="0" ShowCount="false" Style="Visible">
      <PutMethods>
        <Where>
          <IsConstructor Equals="true" />
          <Static Equals="false"/>
        </Where>
        <OrderBy>
          <ParametersCount />
        </OrderBy>
      </PutMethods>
    </CreateRegion>
    <CreateRegion Title="Public Static Methods" PadFirstChild="0" PadLastChild="0" ShowCount="false" Style="Visible">
      <PutMethods>
        <Where>
          <IsConstructor Equals="false" />
          <Static Equals="true" />
          <Access Equals="Public"/>
        </Where>
        <OrderBy>
          <ParametersCount />
        </OrderBy>
      </PutMethods>
    </CreateRegion>
    <CreateRegion Title="Internal Static Methods" PadFirstChild="0" PadLastChild="0" ShowCount="false" Style="Visible">
      <PutMethods>
        <Where>
          <IsConstructor Equals="false" />
          <Static Equals="true" />
          <Access Equals="Internal"/>
        </Where>
        <OrderBy>
          <ParametersCount />
        </OrderBy>
      </PutMethods>
    </CreateRegion>
    <CreateRegion Title="Protected Static Methods" PadFirstChild="0" PadLastChild="0" ShowCount="false" Style="Visible">
      <PutMethods>
        <Where>
          <IsConstructor Equals="false" />
          <Static Equals="true" />
          <Access Equals="Protected"/>
        </Where>
        <OrderBy>
          <ParametersCount />
        </OrderBy>
      </PutMethods>
    </CreateRegion>
    <CreateRegion Title="Private Static Methods" PadFirstChild="0" PadLastChild="0" ShowCount="false" Style="Visible">
      <PutMethods>
        <Where>
          <IsConstructor Equals="false" />
          <Static Equals="true" />
          <Access Equals="Private"/>
        </Where>
        <OrderBy>
          <ParametersCount />
        </OrderBy>
      </PutMethods>
    </CreateRegion>
    <CreateRegion Title="Public Methods" PadFirstChild="0" PadLastChild="0" ShowCount="false" Style="Visible">
      <PutMethods>
        <Where>
          <IsConstructor Equals="false" />
          <Static Equals="false" />
          <Access Equals="Public"/>
        </Where>
        <OrderBy>
          <ParametersCount />
        </OrderBy>
      </PutMethods>
    </CreateRegion>
    <CreateRegion Title="Internal Methods" PadFirstChild="0" PadLastChild="0" ShowCount="false" Style="Visible">
      <PutMethods>
        <Where>
          <IsConstructor Equals="false" />
          <Static Equals="false" />
          <Access Equals="Internal"/>
        </Where>
        <OrderBy>
          <ParametersCount />
        </OrderBy>
      </PutMethods>
    </CreateRegion>
    <CreateRegion Title="Protected Methods" PadFirstChild="0" PadLastChild="0" ShowCount="false" Style="Visible">
      <PutMethods>
        <Where>
          <IsConstructor Equals="false" />
          <Static Equals="false" />
          <Access Equals="Protected"/>
        </Where>
        <OrderBy>
          <ParametersCount />
        </OrderBy>
      </PutMethods>
    </CreateRegion>
    <CreateRegion Title="Private Methods" PadFirstChild="0" PadLastChild="0" ShowCount="false" Style="Visible">
      <PutMethods>
        <Where>
          <IsConstructor Equals="false" />
          <Static Equals="false" />
          <Access Equals="Private"/>
        </Where>
        <OrderBy>
          <ParametersCount />
        </OrderBy>
      </PutMethods>
    </CreateRegion>
    <CreateRegion Title="Events" PadFirstChild="0" PadLastChild="0" ShowCount="false" Style="Visible">
      <PutEvents>
        <OrderBy>
          <Name />
        </OrderBy>
      </PutEvents>
    </CreateRegion>
    <CreateRegion Title="Public Static Properties" PadFirstChild="0" PadLastChild="0" ShowCount="false" Style="Visible">
      <PutProperties>
        <Where>
          <Static Equals="true" />
          <Access Equals="Public"/>
        </Where>
        <OrderBy>
          <Name />
        </OrderBy>
      </PutProperties>
    </CreateRegion>
    <CreateRegion Title="Internal Static Properties" PadFirstChild="0" PadLastChild="0" ShowCount="false" Style="Visible">
      <PutProperties>
        <Where>
          <Static Equals="true" />
          <Access Equals="Internal"/>
        </Where>
        <OrderBy>
          <Name />
        </OrderBy>
      </PutProperties>
    </CreateRegion>
    <CreateRegion Title="Protected Static Properties" PadFirstChild="0" PadLastChild="0" ShowCount="false" Style="Visible">
      <PutProperties>
        <Where>
          <Static Equals="true" />
          <Access Equals="Protected"/>
        </Where>
        <OrderBy>
          <Name />
        </OrderBy>
      </PutProperties>
    </CreateRegion>
    <CreateRegion Title="Private Static Properties" PadFirstChild="0" PadLastChild="0" ShowCount="false" Style="Visible">
      <PutProperties>
        <Where>
          <Static Equals="true" />
          <Access Equals="Private"/>
        </Where>
        <OrderBy>
          <Name />
        </OrderBy>
      </PutProperties>
    </CreateRegion>
    <CreateRegion Title="Public Properties" PadFirstChild="0" PadLastChild="0" ShowCount="false" Style="Visible">
      <PutProperties>
        <Where>
          <Static Equals="false" />
          <Access Equals="Public"/>
        </Where>
        <OrderBy>
          <Name />
        </OrderBy>
      </PutProperties>
    </CreateRegion>
    <CreateRegion Title="Internal Properties" PadFirstChild="0" PadLastChild="0" ShowCount="false" Style="Visible">
      <PutProperties>
        <Where>
          <Static Equals="false" />
          <Access Equals="Internal"/>
        </Where>
        <OrderBy>
          <Name />
        </OrderBy>
      </PutProperties>
    </CreateRegion>
    <CreateRegion Title="Protected Properties" PadFirstChild="0" PadLastChild="0" ShowCount="false" Style="Visible">
      <PutProperties>
        <Where>
          <Static Equals="false" />
          <Access Equals="Protected"/>
        </Where>
        <OrderBy>
          <Name />
        </OrderBy>
      </PutProperties>
    </CreateRegion>
    <CreateRegion Title="Private Properties" PadFirstChild="0" PadLastChild="0" ShowCount="false" Style="Visible">
      <PutProperties>
        <Where>
          <Static Equals="false" />
          <Access Equals="Private"/>
        </Where>
        <OrderBy>
          <Name />
        </OrderBy>
      </PutProperties>
    </CreateRegion>
    <CreateRegion Title="Delegates" PadFirstChild="0" PadLastChild="0" ShowCount="false" Style="Visible">
      <PutDelegates>
        <OrderBy>
          <Name />
        </OrderBy>
      </PutDelegates>
    </CreateRegion>
    <CreateRegion Title="Nested Classes" PadFirstChild="0" PadLastChild="0" ShowCount="false" Style="Visible">
      <PutNestedClasses>
        <OrderBy>
          <Name />
        </OrderBy>
      </PutNestedClasses>
    </CreateRegion>
  </ForEach>
  <Configuration>
    <Symbol>
      <HiddenDragon />
    </Symbol>
    <Rendering ShowCount="false" />
  </Configuration>
</CodeLayout>