Resharp Format XML config

<?xml version="1.0" encoding="utf-8" ?>
<Patterns xmlns="urn:shemas-jetbrains-com:member-reordering-patterns">

  <!--Do not reorder COM interfaces-->
  <Pattern>
    <Match>
      <And Weight="100">
        <Kind Is="interface"/>
        <HasAttribute CLRName="System.Runtime.InteropServices.InterfaceTypeAttribute"/>
      </And>
    </Match>
  </Pattern>

  <!--Special formatting of NUnit test fixture-->
  <Pattern RemoveAllRegions="true">
    <Match>
      <And Weight="100">
        <Kind Is="class"/>
        <HasAttribute CLRName="NUnit.Framework.TestFixtureAttribute" Inherit="true"/>
      </And>
    </Match>

    <!--Setup/Teardow-->
    <Entry>
      <Match>
        <And>
          <Kind Is="method"/>
          <Or>
            <HasAttribute CLRName="NUnit.Framework.SetUpAttribute" Inherit="true"/>
            <HasAttribute CLRName="NUnit.Framework.TearDownAttribute" Inherit="true"/>
            <HasAttribute CLRName="NUnit.Framework.FixtureSetUpAttribute" Inherit="true"/>
            <HasAttribute CLRName="NUnit.Framework.FixtureTearDownAttribute" Inherit="true"/>
          </Or>
        </And>
      </Match>
      <Group Region="Setup/Teardown"/>
    </Entry>

    <!--All other members-->
    <Entry/>

    <!--Test methods-->
    <Entry>
      <Match>
        <And Weight="100">
          <Kind Is="method"/>
          <HasAttribute CLRName="NUnit.Framework.TestAttribute" Inherit="false"/>
        </And>
      </Match>
      <Sort>
        <Name/>
      </Sort>
    </Entry>
  </Pattern>

  <!--Default pattern-->
  <Pattern RemoveAllRegions="true">

    <!--delegate-->
    <Entry>
      <Match>
        <And Weight="100">
          <Access Is="public"/>
          <Kind Is="delegate"/>
        </And>
      </Match>
      <Sort>
        <Access Order="public protected internal private" />
        <Name/>
      </Sort>
      <Group Region="Delegates"/>
    </Entry>

    <!--enums-->
    <Entry>
      <Match>
        <Kind Is="enum"/>
      </Match>
      <Sort>
        <Access Order="public protected internal private" />
        <Name/>
      </Sort>
      <Group Region="Enums"/>
    </Entry>

    <!--constants-->
    <Entry>
      <Match>
        <Kind Is="constant"/>
      </Match>
      <Sort>
        <Access Order="public protected internal private" />
        <Name/>
      </Sort>
      <Group Region="Constants"/>
    </Entry>

    <!--static and readonly fields-->
    <Entry>
      <Match>
        <And>
          <Kind Is="field"/>
          <Or>
            <Static/>
            <Readonly/>
          </Or>
        </And>
      </Match>
      <Sort>
        <Access Order="public protected internal private" />
        <Name/>
      </Sort>
      <Group Region="Readonly &amp; Static Fields"/>
    </Entry>

    <!--fields-->
    <Entry>
      <Match>
        <Kind Is="field"/>
      </Match>
      <Sort>
        <Access Order="public protected internal private" />
        <Name/>
      </Sort>
      <Group Region="Fields"/>
    </Entry>

    <!--Constructors. Place static one first-->
    <Entry>
      <Match>
        <Kind Is="constructor"/>
      </Match>
      <Sort>
        <Static/>
        <Access Order="public protected internal private" />
      </Sort>
      <Group Region="C'tors"/>
    </Entry>

    <!--Destructors. Place static one first-->
    <Entry>
      <Match>
        <Kind Is="destructor"/>
      </Match>
      <Sort>
        <Static/>
        <Access Order="public protected internal private" />
      </Sort>
      <Group Region="Destructors"/>
    </Entry>

    <!--Instance indexers-->
    <Entry>
      <Match>
        <And>
          <Kind Is="indexer"/>
          <Not>
            <Static/>
          </Not>
        </And>
      </Match>
      <Sort>
        <Access Order="public protected internal private" />
        <Abstract/>
        <Virtual/>
        <Override/>
        <Name/>
      </Sort>
      <Group Region="Instance Indexers"/>
    </Entry>

    <!--instance properties-->
    <Entry>
      <Match>
        <And>
          <Kind Is="property"/>
          <Not>
            <Static/>
          </Not>
          <Not>
            <Kind Is="indexer"/>
          </Not>
        </And>
      </Match>
      <Sort>
        <Access Order="public protected internal private" />
        <Abstract/>
        <Virtual/>
        <Override/>
        <Name/>
      </Sort>
      <Group Region="Instance Properties"/>
    </Entry>

    <!--Methods-->
    <Entry>
      <Match>
        <And>
          <Kind Is="method"/>
          <Not>
            <Static/>
          </Not>
          <Not>
            <HandlesEvent />
          </Not>
          <Not>
            <Kind Is="destructor"/>
          </Not>
        </And>
      </Match>
      <Sort>
        <Access Order="public protected internal private" />
        <Abstract/>
        <Virtual/>
        <Override/>
        <Name/>
      </Sort>
      <Group Region="Instance Methods"/>
    </Entry>

    <!--Event Handling-->
    <Entry>
      <Match>
        <HandlesEvent />
      </Match>
      <Sort>
        <Access Order="public protected internal private" />
        <Abstract/>
        <Virtual/>
        <Override/>
        <Name/>
      </Sort>
      <Group Region="Event Handling"/>
    </Entry>

    <!-- event -->
    <Entry>
      <Match>
        <Kind Is="event"/>
      </Match>
      <Sort>
        <Access Order="public protected internal private" />
        <Name/>
      </Sort>
      <Group Region="Event Declarations"/>
    </Entry>

    <!-- operator -->
    <Entry>
      <Match>
        <Kind Is="operator"/>
      </Match>
      <Sort>
        <Access Order="public protected internal private" />
        <Name/>
      </Sort>
      <Group Region="Operators"/>
    </Entry>

    <!--interface implementations-->
    <Entry>
      <Match>
        <And Weight="100">
          <Kind Is="member"/>
          <ImplementsInterface/>
        </And>
      </Match>
      <Sort>
        <ImplementsInterface Immediate="true"/>
      </Sort>
      <Group>
        <ImplementsInterface Immediate="true" Region="${ImplementsInterface} Members"/>
      </Group>
    </Entry>

    <!--Class indexers-->
    <Entry>
      <Match>
        <And>
          <Kind Is="indexer"/>
          <Static/>
        </And>
      </Match>
      <Sort>
        <Access Order="public protected internal private" />
        <Abstract/>
        <Virtual/>
        <Override/>
        <Name/>
      </Sort>
      <Group Region="Class Indexers"/>
    </Entry>

    <!--Class properties-->
    <Entry>
      <Match>
        <And>
          <Kind Is="property"/>
          <Static/>
        </And>
      </Match>
      <Sort>
        <Access Order="public protected internal private" />
        <Abstract/>
        <Virtual/>
        <Override/>
        <Name/>
      </Sort>
      <Group Region="Class Properties"/>
    </Entry>

    <!--Class Methods-->
    <Entry>
      <Match>
        <And>
          <Kind Is="method"/>
          <Static/>
        </And>
      </Match>
      <Sort>
        <Access Order="public protected internal private" />
        <Abstract/>
        <Virtual/>
        <Override/>
        <Name/>
      </Sort>
      <Group Region="Class Methods"/>
    </Entry>

    <!--all other members-->
    <Entry/>

    <!--nested types-->
    <Entry>
      <Match>
        <Kind Is="type"/>
      </Match>
      <Sort>
        <Name/>
      </Sort>
      <Group>
        <Name Region="Nested type: ${Name}"/>
      </Group>
    </Entry>
  </Pattern>

</Patterns>
posted @ 2013-05-04 14:24  张保维  阅读(217)  评论(0编辑  收藏  举报