~halega/+junk/sharpdevelop

« back to all changes in this revision

Viewing changes to data/templates/file/VB/VB.Structure.xft

  • Committer: sk
  • Date: 2011-09-10 05:17:57 UTC
  • Revision ID: halega@halega.com-20110910051757-qfouz1llya9m6boy
4.1.0.7915 Release Candidate 1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0"?>
 
2
<Template author="Siegfried Pammer" version="1.0">
 
3
        
 
4
        <Config
 
5
                  name        = "${res:Templates.File.Structure.Name}"
 
6
                  icon        = "VBNet.File.NewClass"
 
7
                  category    = "VB"
 
8
                  defaultname = "Structure${Number}.vb"
 
9
                  language    = "VBNET"/>
 
10
        
 
11
        <Description>${res:Templates.File.Structure.Description}</Description>
 
12
        
 
13
        <!--
 
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)
 
22
         -->
 
23
        <Files>
 
24
                <File name="${FullName}" language="VBNET"><![CDATA[${StandardHeader.VBNET}
 
25
Imports System
 
26
        
 
27
''' <summary>
 
28
''' Description of ${ClassName}.
 
29
''' </summary>
 
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.
 
37
 
 
38
        Public Overrides Function Equals(obj As Object) As Boolean
 
39
                If TypeOf obj Is ${ClassName} Then
 
40
                        Return Equals(CType(obj, ${ClassName}))
 
41
                Else
 
42
                        ' use Equals method below
 
43
                        Return False
 
44
                End If
 
45
        End Function
 
46
 
 
47
        Public Overloads Function Equals(other As ${ClassName}) As Boolean
 
48
                ' add comparisions for all members here
 
49
                Return Me.member = other.member
 
50
        End Function
 
51
 
 
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()
 
55
        End Function
 
56
 
 
57
        Public Shared Operator =(left As ${ClassName}, right As ${ClassName}) As Boolean
 
58
                Return left.Equals(right)
 
59
        End Operator
 
60
 
 
61
        Public Shared Operator <>(left As ${ClassName}, right As ${ClassName}) As Boolean
 
62
                Return Not left.Equals(right)
 
63
        End Operator
 
64
        #End Region
 
65
End Structure
 
66
]]></File>
 
67
        </Files>
 
68
        
 
69
        <AdditionalOptions/>
 
70
</Template>
 
 
b'\\ No newline at end of file'