()
Surround the selection with parentheses
Scope C++ expressions, C# 2.0+ expressions
Body
( $ SELECTION $$ END $ )
Parameters
SELECTION
- The text selected by the user before invoking the template.
END
- The caret position after the template is applied.
Before expansion
After expansion
{}
Surround the selection with braces
Scope C++ statements, C# 2.0+
Body
{
$ SELECTION $$ END $
}
Parameters
SELECTION
- The text selected by the user before invoking the template.
END
- The caret position after the template is applied.
Before expansion
After expansion
namespace
Add a namespace to the selected code
Scope C# 2.0+ types and namespaces
Body
namespace $ NAME $ { $ END $$ SELECTION $ }
Parameters
NAME
- Gets default namespace for the current file (fileDefaultNamespace )
SELECTION
- The text selected by the user before invoking the template.
END
- The caret position after the template is applied.
Before expansion
After expansion
if
Put the selection into an
if
statement block
Scope C# 2.0+ statements
Body
if ( $ END $ ){ $ SELECTION $ }
Parameters
SELECTION
- The text selected by the user before invoking the template.
END
- The caret position after the template is applied.
Before expansion
After expansion
if..else
Put the selection into an
if
statement block and add an
else
block
Scope C# 2.0+ statements
Body
if ( $ COND $ )
{
$ SELECTION $
}
else
{
$ END $
}
Parameters
COND
- Suggests variables of the specified type. (variableOfType )
SELECTION
- The text selected by the user before invoking the template.
END
- The caret position after the template is applied.
Before expansion
After expansion
while
Put the selection into a
while
loop
Scope C# 2.0+ statements
Body
while ( $ END $ ){ $ SELECTION $ }
Parameters
SELECTION
- The text selected by the user before invoking the template.
END
- The caret position after the template is applied.
Before expansion
After expansion
for
Put the selection into a
for
loop
Scope C# 2.0+ statements
Body
for ( $ END $ ){ $ SELECTION $ }
Parameters
SELECTION
- The text selected by the user before invoking the template.
END
- The caret position after the template is applied.
Before expansion
After expansion
do..while
Put the selection into a
do..while
loop
Scope C# 2.0+ statements
Body
do { $ SELECTION $ } while ( $ END $ );
Parameters
SELECTION
- The text selected by the user before invoking the template.
END
- The caret position after the template is applied.
Before expansion
After expansion
#region
Surround the selection with a region
Scope C# 2.0+
Body
#region $END$
$ SELECTION $
#endregion
Parameters
SELECTION
- The text selected by the user before invoking the template.
END
- The caret position after the template is applied.
Before expansion
After expansion
#if..#endif
Surround the selection with a pair of preprocessor directives
Scope C# 2.0+
Body
#if $END$
$ SELECTION $
#endif
Parameters
SELECTION
- The text selected by the user before invoking the template.
END
- The caret position after the template is applied.
Before expansion
After expansion
try..catch
Put the selection into the
try
block of the
try..catch
statement
Scope C# 2.0+ statements
Body
try { $ SELECTION $ } catch ( $ EXCEPTION $ $ EX_NAME $ ) {
$ SELSTART $ System . Console . WriteLine ( $ EX_NAME $ ); $ SELEND $
}
Parameters
EXCEPTION
- Evaluates to the specified constant value. (constant )
EX_NAME
- When exectuted in variable declaration (where variable name should stand), suggests name for the variable. (suggestVariableName )
SELECTION
- The text selected by the user before invoking the template.
Before expansion
After expansion
try..finally
Put the selection into the
try
block of the
try..finally
statement
Scope C# 2.0+ statements
Body
try { $ SELECTION $ } finally {
$ END $
}
Parameters
EXCEPTION
- Evaluates to the specified constant value. (constant )
EX_NAME
- When exectuted in variable declaration (where variable name should stand), suggests name for the variable. (suggestVariableName )
SELECTION
- The text selected by the user before invoking the template.
END
- The caret position after the template is applied.
Before expansion
After expansion
cast
Cast the selection to a specific type
Scope C# 2.0+ expressions
Body
(( $ TYPE $ ) $ SELECTION $ )
Parameters
TYPE
- Guess type expected at this point (guessExpectedType )
SELECTION
- The text selected by the user before invoking the template.
Before expansion
After expansion
using
Put the selection into the
using
statement
Scope C# 2.0+ statements
Body
using ( $ END $ ){ $ SELECTION $ }
Parameters
SELECTION
- The text selected by the user before invoking the template.
END
- The caret position after the template is applied.
Before expansion
After expansion
String.Format
Integrate the selected format string into the
String.Format
method call
Scope C# 2.0+ expressions
Body
string . Format ( $ SELECTION $ , $ END $ );
Parameters
SELECTION
- The text selected by the user before invoking the template.
END
- The caret position after the template is applied.
Before expansion
After expansion
lock
Put the selection into a
lock
statement
Scope C# 2.0+ statements
Body
lock ( $ LOCK $ )
{
$ SELECTION $$ END $
}
Parameters
LOCK
- Suggests variables of the specified type. (variableOfType )
SELECTION
- The text selected by the user before invoking the template.
END
- The caret position after the template is applied.
Before expansion
After expansion