Predefined Live Templates for VB.NET
This topic lists all predefined live templates for VB.NET in JetBrains Rider 2023.3. For more information about live templates, refer to Create source code using live templates.
Template | Details |
---|---|
| Current file context Scope Everywhere Body $CTX$ Parameters
|
| Insert new GUID Scope Everywhere Body $GUID$ Parameters
|
| For Each block Scope VB.NET 8.0+ statements Body For Each $VAR$ As $TYPE$ In $COL$
$END$
Next Parameters
After you specify the parameters, the caret is positioned so that you can continue coding the loop body. |
| Iterate an array Scope VB.NET 8.0+ statements Body For $VAR$ As Integer = 0 To $ARRAY$.Length - 1
Dim $ELEMENT$ As $TYPE$ = $ARRAY$($VAR$)
$END$
Next Parameters
After you specify the parameters, the caret is positioned so that you can continue coding the loop body. |
| Iterate generic System.Collections.Generic.IList(Of T) Scope VB.NET 8.0+ statements Body For $INDEX$ As Integer = 0 To $LIST$.Count - 1
Dim $ELEM$ As $TYPE$ = $LIST$($INDEX$)
$END$
Next Parameters
Generates a After you specify the parameters, the caret is positioned so that you can continue coding the loop body. |
| Simple "For" loop Scope VB.NET 8.0+ statements Body For $VAR$ As Integer = 0 To $MAX$
$END$
Next Parameters
After you specify the parameters, the caret is positioned so that you can continue coding the loop body. |
| Iterate array in reverse order Scope VB.NET 8.0+ statements Body For $VAR$ As Integer = $ARR$.Length - 1 To 0 Step -1
Dim $ELEM$ As $TYPE$ = $ARR$($VAR$)
$END$
Next Parameters
After you specify the parameters, the caret is positioned so that you can continue coding the loop body. |
| Declare a variable Scope VB.NET 8.0+ statements, VB.NET 8.0+ type members Body Dim $VAR$ As $TYPE$ Parameters
|
| Make an assertion Scope VB.NET 8.0+ statements Body System.Diagnostics.Debug.Assert($END$) Parameters
The template calls the |
| Print a string Scope VB.NET 8.0+ statements Body System.Console.WriteLine("$END$") Parameters
|
| Print value of an expression Scope VB.NET 8.0+ statements Body System.Console.WriteLine("$EXPR$ = {0}", $EXPR$) Parameters
|
| Public Shared Sub Main Scope VB.NET 8.0+ type members Body Public Shared Sub Main
$END$
End Sub Parameters
|
| Safely cast a variable Scope VB.NET 8.0+ statements Body Dim $VAR$ As $TYPE$ = TryCast($EXPR$, $TYPE$)
If $VAR$ IsNot Nothing Then
$END$
End If Parameters
|
| Subroutine declaration Scope VB.NET 8.0+ type members Body Sub $NAME$()
$END$
End Sub Parameters
|
| Function declaration Scope VB.NET 8.0+ type members Body Function $NAME$() As $TYPE$
$END$
End Function Parameters
|
| DirectCast clause Scope VB.NET 8.0+ expressions Body DirectCast($EXPR$, $TYPE$) Parameters
|
| TryCast clause Scope VB.NET 8.0+ expressions Body TryCast($EXPR$, $TYPE$) Parameters
|
| CType clause Scope VB.NET 8.0+ expressions Body CType($EXPR$, $TYPE$) Parameters
|
| ByRef parameter Scope VB.NET 8.0+ method parameters Body ByRef $PARAM_NAME$ As $PARAM_TYPE$ Parameters
|
| ByVal parameter Scope VB.NET 8.0+ method parameters Body ByVal $PARAM_NAME$ As $PARAM_TYPE$ Parameters
|
| Select case statement Scope VB.NET 8.0+ statements Body Select Case $expression$
$END$
End Select Parameters
|
| Attached property Scope VB.NET 8.0+ type members Body Public Shared ReadOnly $propertyName$Property As $dependencyProperty$ = $dependencyProperty$.RegisterAttached( _
"$propertyName$", GetType($propertyType$), GetType($containingType$), new PropertyMetadata(Nothing))
Public Shared Function Get$propertyName$(ByVal $element$ As DependencyObject) As $propertyType$
Return DirectCast($element$.GetValue($propertyName$Property), $propertyType$)
End Function
Public Shared Sub Set$propertyName$(ByVal $element$ As DependencyObject, ByVal value As $propertyType$)
$element$.SetValue($propertyName$Property, value)
End Sub
Parameters
|
| Dependency property Scope VB.NET 8.0+ type members Body Public Shared ReadOnly $propertyName$Property As $dependencyProperty$ = $dependencyProperty$.Register( _
"$propertyName$", GetType($propertyType$), GetType($containingType$), new PropertyMetadata(Nothing))
Public Property $propertyName$ As $propertyType$
Get
Return DirectCast(GetValue($propertyName$Property), $propertyType$)
End Get
Set
SetValue($propertyName$Property, value)
End Set
End Property Parameters
|
| Scope VB.NET 8.0+ type members, MSTest Test Project Body <Microsoft.VisualStudio.TestTools.UnitTesting.TestMethod>
Sub $METHOD$()
$END$
End Sub
Parameters
|