ReSharper 2016.3 Help

Predefined Surround Templates for VB.NET

ReSharper | Templates Explorer | Surround Templates | VB.NET

This topic lists all predefined surround templates for VB.NET in ReSharper 2016.3.1. For more information about surround templates, see Surrounding Code Fragments with Templates

TemplateDetails
If

Put the selection into the statement block following Then in the If-Then construct

Scope VB.NET 8+ statements

Body

If $END$ Then $SELECTION$ End If

Parameters

  • SELECTION - The text selected by the user before invoking the template.
  • END - The caret position after the template is applied.

Before expansion
/help/img/dotnet/2016.3/Reference__Options__Templates__Surround_With_Templates__Predefined__VB.NET__If__before.png
After expansion

/help/img/dotnet/2016.3/Reference__Options__Templates__Surround_With_Templates__Predefined__VB.NET__If__after.png

If..Else

Put the selection into the statement block following Then in the If-Then-Else construct

Scope VB.NET 8+ statements

Body

If $COND$ Then $SELECTION$ Else $END$ End If

Parameters

  • COND - no macro
  • SELECTION - The text selected by the user before invoking the template.
  • END - The caret position after the template is applied.

Before expansion
/help/img/dotnet/2016.3/Reference__Options__Templates__Surround_With_Templates__Predefined__VB.NET__If..Else__before.png
After expansion

/help/img/dotnet/2016.3/Reference__Options__Templates__Surround_With_Templates__Predefined__VB.NET__If..Else__after.png

SyncLock

Transform the selection into the SyncLock statement

Scope VB.NET 8+ statements

Body

SyncLock $END$ $SELECTION$ End SyncLock

Parameters

  • SELECTION - The text selected by the user before invoking the template.
  • END - The caret position after the template is applied.

Before expansion

/help/img/dotnet/2016.3/Reference__Options__Templates__Surround_With_Templates__Predefined__VB.NET__SyncLock__before.png

After expansion
/help/img/dotnet/2016.3/Reference__Options__Templates__Surround_With_Templates__Predefined__VB.NET__SyncLock__after.png

Using

Put the selection into the Using statement

Scope VB.NET 8+ statements

Body

Using $END$ $SELECTION$ End Using

Parameters

  • SELECTION - The text selected by the user before invoking the template.
  • END - The caret position after the template is applied.

Before expansion
/help/img/dotnet/2016.3/Reference__Options__Templates__Surround_With_Templates__Predefined__VB.NET__using__before.png
After expansion

/help/img/dotnet/2016.3/Reference__Options__Templates__Surround_With_Templates__Predefined__VB.NET__using__after.png

tc

Wrap the selection into the TryCast

Scope VB.NET 8+ expressions

Body

TryCast($SELECTION$, $TYPE$)

Parameters

  • TYPE - Guess type expected at this point (guessExpectedType)
  • SELECTION - The text selected by the user before invoking the template.

Before expansion

/help/img/dotnet/2016.3/Reference__Options__Templates__Surround_With_Templates__Predefined__VB.NET__TryCast__before.png

After expansion
/help/img/dotnet/2016.3/Reference__Options__Templates__Surround_With_Templates__Predefined__VB.NET__TryCast__after.png

ct

Transform the selection into the first parameter of the CType() function

Scope VB.NET 8+ expressions

Body

CType($SELECTION$, $TYPE$)

Parameters

  • TYPE - Guess type expected at this point (guessExpectedType)
  • SELECTION - The text selected by the user before invoking the template.

Before expansion

/help/img/dotnet/2016.3/Reference__Options__Templates__Surround_With_Templates__Predefined__VB.NET__CType__before.png

After expansion
/help/img/dotnet/2016.3/Reference__Options__Templates__Surround_With_Templates__Predefined__VB.NET__CType__after.png

dc

Transform the selection into the first parameter of the DirectCast function.

Scope VB.NET 8+ expressions

Body

DirectCast($SELECTION$, $TYPE$)

Parameters

  • TYPE - Guess type expected at this point (guessExpectedType)
  • SELECTION - The text selected by the user before invoking the template.

Before expansion

/help/img/dotnet/2016.3/Reference__Options__Templates__Surround_With_Templates__Predefined__VB.NET__DirectCast__before.png

After expansion
/help/img/dotnet/2016.3/Reference__Options__Templates__Surround_With_Templates__Predefined__VB.NET__DirectCast__after.png

namespace

Add a namespace to the selected code

Scope VB.NET 8+ types or namespaces

Body

Namespace $END$ $SELECTION$ End Namespace

Parameters

  • SELECTION - The text selected by the user before invoking the template.
  • END - The caret position after the template is applied.

Before expansion

/help/img/dotnet/2016.3/Reference__Options__Templates__Surround_With_Templates__Predefined__VB.NET__namespace__before.png

After expansion
/help/img/dotnet/2016.3/Reference__Options__Templates__Surround_With_Templates__Predefined__VB.NET__namespace__after.png

Last modified: 23 January 2017