ReSharper automatically suggests a list of all variables in the current scope and, by default, selects the most recently declared one. The descriptive text string (s = in the example above) is automatically synchronized with the name of the selected variable.

out

Print a string

Scope C# 2.0+ statements

Body

System.Console.Out.WriteLine("$END$");

Parameters

END - The caret position after the template is applied.

Before expansionAfter expansion

asrt

Make an assertion

Scope C# 2.0+ statements

Body

System.Diagnostics.Debug.Assert($END$);

Parameters

END - The caret position after the template is applied.

Before expansionAfter expansion

This template calls the Debug.Assert method, which is used for debugging purposes. After the template expanded, the caret moves between the parentheses so that you can specify a condition.

asrtn

Assert expression not null

Scope C# 2.0+ statements

Body

System.Diagnostics.Debug.Assert($EXPR$!=null,"$MESSAGE$");

Parameters

EXPR - no macro

MESSAGE - no macro

Before expansionAfter expansion

The template inserts the Debug.Assert method, which checks a condition and displays a message if the condition is false.

thr

throw new

Scope C# 2.0+ statements

Body

thrownew

Before expansionAfter expansion

pci

public const int

Scope C# 2.0+ type members

Body

publicconstint

Before expansionAfter expansion

pcs

public const string

Scope C# 2.0+ type members

Body

publicconststring

Before expansionAfter expansion

psr

public static readonly

Scope C# 2.0+ type members

Body

publicstaticreadonly

Before expansionAfter expansion

prop

Property

Scope C# 2.0+ type members

Body

public$TYPE$$NAME${get;set;}

Parameters

TYPE - no macro

NAME - When exectuted in variable declaration (where variable name should stand), suggests name for the variable. (suggestVariableName)

Before expansionAfter expansion

ear

Create an empty array

Scope C# 2.0+ statements

Body

$TYPE$[]$NAME$=new$TYPE$[]{};

Parameters

TYPE - no macro

NAME - When exectuted in variable declaration (where variable name should stand), suggests name for the variable. (suggestVariableName)

property - When exectuted in variable declaration (where variable name should stand), suggests name for the variable. (suggestVariableName)

Attribute (Imported Visual C# Snippets)

Code snippet for attribute using recommended pattern

Scope C# 2.0+ type members, C# 2.0+ types and namespaces

Body

[System.AttributeUsage(System.AttributeTargets.$target$, Inherited = $inherited$, AllowMultiple = $allowmultiple$)]sealedclass$name$Attribute:System.Attribute{// See the attribute guidelines at // http://go.microsoft.com/fwlink/?LinkId=85236readonlystringpositionalString;// This is a positional argumentpublic$name$Attribute(stringpositionalString){this.positionalString=positionalString;// TODO: Implement code here$SELSTART$thrownewSystem.NotImplementedException();$SELEND$}publicstringPositionalString{get;privateset;}// This is a named argumentpublicintNamedInt{get;set;}}