Browse Source

- added some code snippets for loops and conditional statements

- converted Exception template to VB

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/vbnet@6073 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Siegfried Pammer 15 years ago
parent
commit
2868186abc
  1. 56
      data/templates/file/VBNet/VBNet.Exception.xft
  2. 63
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Snippets/SnippetManager.cs

56
data/templates/file/VBNet/VBNet.Exception.xft

@ -0,0 +1,56 @@ @@ -0,0 +1,56 @@
<?xml version="1.0"?>
<Template author="Siegfried Pammer" version="1.0.0">
<Config
name = "${res:Templates.File.Exception.Name}"
icon = "VBNet.File.NewClass"
category = "VB"
defaultname = "Exception.vb"
language = "VBNET"/>
<Description>${res:Templates.File.Exception.Description}</Description>
<!--
Special new file templates:
${StandardNamespace} -> Standardnamespace of the current project or FileNameWithoutExtension
${FullName} -> Full generated path name
${FileName} -> File name with extension
${FileNameWithoutExtension} -> File name without extension
${Extension} -> Extension in the form ".cs"
${Path} -> Full path of the file
-->
<Files>
<File name="${FullName}" language="VBNET"><![CDATA[${StandardHeader.VBNET}
Imports System
Imports System.Runtime.Serialization
Namespace ${StandardNamespace}
''' <summary>
''' Desctiption of ${ClassName}.
''' </summary>
Public Class ${ClassName}
Inherits Exception
Implements ISerializable
Public Sub New()
End Sub
Public Sub New(message As String)
MyBase.New(message)
End Sub
Public Sub New(message As String, innerException As Exception)
MyBase.New(message, innerException)
End Sub
' This constructor is needed for serialization.
Protected Sub New(info As SerializationInfo, context As StreamingContext)
MyBase.New(info, context)
End Sub
End Class
End Namespace]]></File>
</Files>
<AdditionalOptions/>
</Template>

63
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Snippets/SnippetManager.cs

@ -136,6 +136,69 @@ namespace ICSharpCode.AvalonEdit.AddIn.Snippets @@ -136,6 +136,69 @@ namespace ICSharpCode.AvalonEdit.AddIn.Snippets
Text = "For ${counter=i} As ${type=Integer} = ${start=0} To ${end} Step ${step=1}\n" +
"\t${Selection}\n" +
"Next ${counter}"
},
new CodeSnippet {
Name = "DoLoopUn",
Description = "Do ... Loop Until statement",
Text = "Do\n" +
"\t${Selection}\n" +
"Loop Until ${expression}"
},
new CodeSnippet {
Name = "DoLoopWh",
Description = "Do ... Loop While statement",
Text = "Do\n" +
"\t${Selection}\n" +
"Loop While ${expression}"
},
new CodeSnippet {
Name = "DoWhile",
Description = "Do While ... Loop statement",
Text = "Do While ${expression}\n" +
"\t${Selection}\n" +
"Loop"
},
new CodeSnippet {
Name = "DoUntil",
Description = "Do Until ... Loop statement",
Text = "Do Until ${expression}\n" +
"\t${Selection}\n" +
"Loop"
},
new CodeSnippet {
Name = "ForEach",
Description = "For Each statement",
Text = "For Each ${item} As ${type} In ${collection}\n" +
"\t${Selection}\n" +
"Next"
},
new CodeSnippet {
Name = "IfElseIf",
Description = "If ... ElseIf ... End If statement",
Text = @"If ${condition1} Then
${Selection}
ElseIf ${condition2} Then
${Caret}
Else
End If"
},
new CodeSnippet {
Name = "While",
Description = "While statement",
Text = @"While ${condition}
${Selection}
End While"
},
new CodeSnippet {
Name = "Select",
Description = "Select statement",
Text = @"Select Case ${variable}
Case ${case1}
${Selection}
Case Else
${Caret}
End Select"
}
}
}

Loading…
Cancel
Save