2
<Template author="Siegfried Pammer" version="1.0">
5
name = "${res:Templates.File.Structure.Name}"
6
icon = "VBNet.File.NewClass"
8
defaultname = "Structure${Number}.vb"
11
<Description>${res:Templates.File.Structure.Description}</Description>
14
Special new file templates:
15
${StandardNamespace} -> Standardnamespace of the current project or FileNameWithoutExtension
16
${FullName} -> Full generated path name
17
${FileName} -> File name with extension
18
${FileNameWithoutExtension} -> File name without extension
19
${Extension} -> Extension in the form ".vb"
20
${Path} -> Full path of the file
21
${ClassName} -> Structure name (generally FileNameWithoutExtension w/o 'bad' characters)
24
<File name="${FullName}" language="VBNET"><![CDATA[${StandardHeader.VBNET}
28
''' Description of ${ClassName}.
30
Public Structure ${ClassName}
31
Implements IEquatable(Of ${ClassName})
32
Private member As Integer
33
' this is just an example member, replace it with your own struct members!
34
#Region "Equals and GetHashCode implementation"
35
' The code in this region is useful if you want to use this structure in collections.
36
' If you don't need it, you can just remove the region and the "Implements IEquatable(Of ${ClassName})" declaration.
38
Public Overrides Function Equals(obj As Object) As Boolean
39
If TypeOf obj Is ${ClassName} Then
40
Return Equals(CType(obj, ${ClassName}))
42
' use Equals method below
47
Public Overloads Function Equals(other As ${ClassName}) As Boolean
48
' add comparisions for all members here
49
Return Me.member = other.member
52
Public Overrides Function GetHashCode() As Integer
53
' combine the hash codes of all members here (e.g. with XOr operator)
54
Return member.GetHashCode()
57
Public Shared Operator =(left As ${ClassName}, right As ${ClassName}) As Boolean
58
Return left.Equals(right)
61
Public Shared Operator <>(left As ${ClassName}, right As ${ClassName}) As Boolean
62
Return Not left.Equals(right)
b'\\ No newline at end of file'