Skip to content

Instantly share code, notes, and snippets.

@hazzik
Created November 23, 2011 18:46
Show Gist options
  • Save hazzik/1389518 to your computer and use it in GitHub Desktop.
Save hazzik/1389518 to your computer and use it in GitHub Desktop.
R# Type Members Layout
<?xml version="1.0" encoding="utf-8" ?>
<Patterns xmlns="urn:shemas-jetbrains-com:member-reordering-patterns">
<!--Do not reorder COM interfaces and structs marked by StructLayout attribute-->
<Pattern>
<Match>
<Or Weight="100">
<And>
<Kind Is="interface"/>
<Or>
<HasAttribute CLRName="System.Runtime.InteropServices.InterfaceTypeAttribute"/>
<HasAttribute CLRName="System.Runtime.InteropServices.ComImport"/>
</Or>
</And>
<HasAttribute CLRName="System.Runtime.InteropServices.StructLayoutAttribute"/>
</Or>
</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>
<!--public delegate-->
<Entry>
<Match>
<And Weight="100">
<Access Is="public"/>
<Kind Is="delegate"/>
</And>
</Match>
<Sort>
<Name/>
</Sort>
<Group Region="Delegates"/>
</Entry>
<!--public enum-->
<Entry>
<Match>
<And Weight="100">
<Access Is="public"/>
<Kind Is="enum"/>
</And>
</Match>
<Sort>
<Name/>
</Sort>
<Group>
<Name Region="${Name} enum"/>
</Group>
</Entry>
<!--static fields and constants-->
<Entry>
<Match>
<Or>
<Kind Is="constant"/>
<And>
<Kind Is="field"/>
<Static/>
</And>
</Or>
</Match>
<Sort>
<Kind Order="constant field"/>
</Sort>
</Entry>
<!--instance fields-->
<Entry>
<Match>
<And>
<Kind Is="field"/>
<Not>
<Static/>
</Not>
</And>
</Match>
<Sort>
<Readonly/>
<Name/>
</Sort>
</Entry>
<!--Constructors. Place static one first-->
<Entry>
<Match>
<Or>
<Kind Is="destructor"/>
<Kind Is="constructor"/>
</Or>
</Match>
<Sort>
<Kind Order="constructor destructor"/>
<Static/>
</Sort>
</Entry>
<!--properties, indexers-->
<Entry>
<Match>
<Or>
<Kind Is="property"/>
<Kind Is="indexer"/>
</Or>
</Match>
<Sort>
<Access Order="public internal protected private"/>
<Static/>
<Name/>
</Sort>
</Entry>
<!--interface implementations-->
<Entry>
<Match>
<And Weight="100">
<Kind Is="member"/>
<ImplementsInterface/>
</And>
</Match>
<Sort>
<ImplementsInterface Immediate="true"/>
</Sort>
</Entry>
<!--methods and operators-->
<Entry>
<Match>
<Or>
<Kind Is="operator"/>
<Kind Is="method"/>
</Or>
</Match>
<Sort>
<Kind Order="operator method"/>
<Access Order="public internal protected private"/>
<Static/>
<Name/>
</Sort>
</Entry>
<!--all other members-->
<Entry />
<!--nested types-->
<Entry>
<Match>
<Kind Is="type"/>
</Match>
<Sort>
<Name/>
</Sort>
</Entry>
</Pattern>
</Patterns>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment