This project is read-only.

Code Style

StyleCop

The code should be compliant with the latest StyleCop, with the following rules disabled:
  • SA1200

ReSharper

A ReSharper code style settings file is available via source control.
Project members get access to a full version of ReSharper.

StyleCop for ReSharper

We don't use regions in our code. However, the default behavior of the StyleCop plugin for ReSharper is to syntactically group type members into regions (#region properties, #region methods, #region ...).

To disable this behavior:
  • ReSharper | Options... | Code Editing | C# | Type Members Layout | Custom Layout
  • find and delete all occurrences of `<Group Region="..."/>`
You must repeat these steps whenever you press the [Reset C# Code Style Options] button.

Type Member Layout

Please use the provided type members layout for automated code cleanup. This layout was copied from the default template, then tweaked to meet our specific needs.

<?xml version="1.0" encoding="utf-8"?>
<!-- Last updated 15.05.2012 -->
<Patterns xmlns="urn:shemas-jetbrains-com:member-reordering-patterns">
	<!-- Do not reorder COM interfaces -->
	<Pattern>
		<Match>
			<And Weight="2000">
				<Kind Is="interface"/>
				<Or>
					<HasAttribute CLRName="System.Runtime.InteropServices.InterfaceTypeAttribute"/>
					<HasAttribute CLRName="System.Runtime.InteropServices.ComImport"/>
				</Or>
			</And>
		</Match>
	</Pattern>
	<!-- Do not reorder P/Invoke structs -->
	<Pattern>
		<Match>
			<And Weight="2000">
				<Or>
					<Kind Is="struct"/>
					<Kind Is="class"/>
				</Or>
				<HasAttribute CLRName="System.Runtime.InteropServices.StructLayoutAttribute"/>
			</And>
		</Match>
	</Pattern>
	<!-- Do not reorder P/Invoke classes (called xxxNativeMethods) -->
	<Pattern>
		<Match>
			<And Weight="2000">
				<Kind Is="class"/>
				<Name Is=".*NativeMethods" />
			</And>
		</Match>
	</Pattern>
	<!-- Do not reorder DataContract structs or classes -->
	<Pattern>
		<Match>
			<And Weight="2000">
				<Or>
					<Kind Is="struct"/>
					<Kind Is="class"/>
				</Or>
				<HasAttribute CLRName="System.Runtime.Serialization.DataContractAttribute"/>
			</And>
		</Match>
	</Pattern>
	<!-- Do not reorder DataContract structs or classes (called xxxDataContract) -->
	<Pattern>
		<Match>
			<And Weight="2000">
				<Or>
					<Kind Is="struct"/>
					<Kind Is="class"/>
				</Or>
				<Name Is=".*DataContract" />
			</And>
		</Match>
	</Pattern>
	<!-- StyleCop pattern -->
	<Pattern RemoveAllRegions="true">
		<Match>
			<Or Weight="1000" >
				<Kind Is="class" />
				<Kind Is="struct" />
				<Kind Is="interface"/>
			</Or>
		</Match>
		<!-- Constants -->
		<Entry>
			<Match>
				<Kind Is="constant"/>
			</Match>
			<Sort>
				<Access Order="public internal protected-internal protected private"/>
				<Name/>
			</Sort>
		</Entry>
		<!-- Static fields -->
		<Entry>
			<Match>
				<And>
					<Kind Is="field"/>
					<Static />
				</And>
			</Match>
			<Sort>
				<Access Order="public internal protected-internal protected private"/>
				<Readonly/>
				<Name/>
			</Sort>
		</Entry>
		<!-- Fields -->
		<Entry>
			<Match>
				<Kind Is="field"/>
			</Match>
			<Sort>
				<Access Order="public internal protected-internal protected private"/>
				<Readonly/>
				<Name/>
			</Sort>
		</Entry>
		<!-- constructors and destructors -->
		<Entry>
			<Match>
				<Or Weight="200">
					<Kind Is="constructor"/>
					<Kind Is="destructor"/>
				</Or>
			</Match>
			<Sort>
				<Static/>
				<Kind Order="constructor destructor"/>
				<Access Order="public internal protected-internal protected private"/>
			</Sort>
		</Entry>
		<!-- delegates -->
		<Entry>
			<Match>
				<Kind Is="delegate"/>
			</Match>
			<Sort>
				<Access Order="public internal protected-internal protected private" />
				<Static />
				<Name/>
			</Sort>
		</Entry>
		<!-- public events -->
		<Entry>
			<Match>
				<And>
					<Kind Is="event"/>
					<Access Is="public"/>
				</And>
			</Match>
			<Sort>
				<Access Order="public" />
				<Static />
				<Name/>
			</Sort>
		</Entry>
		<!-- interface events -->
		<Entry>
			<Match>
				<And>
					<Kind Is="event"/>
					<ImplementsInterface/>
				</And>
			</Match>
			<Sort>
				<ImplementsInterface Immediate="true"/>
				<Name/>
			</Sort>
		</Entry>
		<!-- other events -->
		<Entry>
			<Match>
				<Kind Is="event"/>
			</Match>
			<Sort>
				<Access Order="public internal protected-internal protected private" />
				<Static />
				<Name/>
			</Sort>
		</Entry>
		<!-- enum -->
		<Entry>
			<Match>
				<Kind Is="enum"/>
			</Match>
			<Sort>
				<Access Order="public internal protected-internal protected private" />
				<Name/>
			</Sort>
		</Entry>
		<!-- interfaces -->
		<Entry>
			<Match>
				<Kind Is="interface" />
			</Match>
			<Sort>
				<Access Order="public internal protected-internal protected private" />
				<Name/>
			</Sort>
		</Entry>
		<!-- public properties -->
		<Entry>
			<Match>
				<And>
					<Kind Is="property"/>
					<Access Is="public"/>
				</And>
			</Match>
			<Sort>
				<Access Order="public"/>
				<Static/>
				<Name/>
			</Sort>
		</Entry>
		<!-- interface properties -->
		<Entry>
			<Match>
				<And>
					<Kind Is="property"/>
					<ImplementsInterface/>
				</And>
			</Match>
			<Sort>
				<ImplementsInterface Immediate="true"/>
				<Name/>
			</Sort>
		</Entry>
		<!-- other properties -->
		<Entry>
			<Match>
				<Kind Is="property"/>
			</Match>
			<Sort>
				<Access Order="public internal protected-internal protected private"/>
				<Static/>
				<Name/>
			</Sort>
		</Entry>
		<!-- public indexers -->
		<Entry>
			<Match>
				<And>
					<Kind Is="indexer" Weight="1000" />
					<Access Is="public"/>
				</And>
			</Match>
			<Sort>
				<Access Order="public" />
				<Static/>
				<Name/>
			</Sort>
		</Entry>
		<!-- interface indexers -->
		<Entry>
			<Match>
				<And>
					<Kind Is="indexer" Weight="1000"/>
					<ImplementsInterface/>
				</And>
			</Match>
			<Sort>
				<ImplementsInterface Immediate="true"/>
				<Name/>
			</Sort>
		</Entry>
		<!-- other indexers -->
		<Entry>
			<Match>
				<Kind Is="indexer" Weight="1000" />
			</Match>
			<Sort>
				<Access Order="public internal protected-internal protected private" />
				<Static/>
				<Name/>
			</Sort>
		</Entry>
		<!-- public methods (includes operators) -->
		<Entry>
			<Match>
				<And>
					<Or>
						<Kind Is="method"/>
						<Kind Is="operator"/>
					</Or>
					<Access Is="public"/>
				</And>
			</Match>
			<Sort>
				<Access Order="public"/>
				<Static/>
				<Name/>
			</Sort>
		</Entry>
		<!-- interface methods -->
		<Entry>
			<Match>
				<And>
					<Kind Is="method"/>
					<ImplementsInterface/>
				</And>
			</Match>
			<Sort>
				<ImplementsInterface Immediate="true"/>
				<Name/>
			</Sort>
		</Entry>
		<!-- other methods -->
		<Entry>
			<Match>
				<Kind Is="method"/>
			</Match>
			<Sort>
				<Access Order="public internal protected-internal protected private"/>
				<Static/>
				<Name/>
			</Sort>
		</Entry>
		<!-- operators -->
		<Entry>
			<Match>
				<Kind Is="operator"/>
			</Match>
			<Sort>
				<Access Order="public internal protected-internal protected private" />
				<Static/>
				<Name/>
			</Sort>
		</Entry>
		<!-- Nested structs -->
		<Entry>
			<Match>
				<Kind Is="struct" Weight="600" />
			</Match>
			<Sort>
				<Static />
				<Access Order="public internal protected-internal protected private" />
				<Name/>
			</Sort>
		</Entry>
		<!-- Nested classes -->
		<Entry>
			<Match>
				<Kind Is="class" Weight="700" />
			</Match>
			<Sort>
				<Static />
				<Access Order="public internal protected-internal protected private" />
				<Name/>
			</Sort>
		</Entry>
		<!-- all other members -->
		<Entry/>
	</Pattern>
</Patterns>

Last edited Oct 30, 2014 at 9:19 PM by StevenLiekens, version 7