ReSharper | Templates Explorer | Surround Templates | VB.NET"
This topic lists all predefined surround templates for VB.NET in ReSharper 2023.2. For more information about surround templates, refer to Surround code fragments with templates.
Template
Details
If
Put the selection into the statement block following Then in the If-Then construct
Scope VB.NET 8.0+ statements
Body
If $END$Then
$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
If..Else
Put the selection into the statement block following Then in the If-Then-Else construct
Scope VB.NET 8.0+ statements
Body
If $COND$ Then
$SELECTION$
Else
$END$EndIf
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
After expansion
SyncLock
Transform the selection into the SyncLock statement
Scope VB.NET 8.0+ statements
Body
SyncLock $END$
$SELECTION$
EndSyncLock
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
Using
Put the selection into the Using statement
Scope VB.NET 8.0+ statements
Body
Using $END$
$SELECTION$
EndUsing
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
tc
Wrap the selection into the TryCast
Scope VB.NET 8.0+ expressions
Body
TryCast($SELECTION$, $TYPE$)
Parameters
TYPE - Guesses the type expected at this point
SELECTION - The text selected by the user before invoking the template.
Before expansion
After expansion
ct
Transform the selection into the first parameter of the CType() function
Scope VB.NET 8.0+ expressions
Body
CType($SELECTION$, $TYPE$)
Parameters
TYPE - Guesses the type expected at this point
SELECTION - The text selected by the user before invoking the template.