2 Imports System
.Reflection
7 <AttributeUsage(AttributeTargets
.All
, Inherited
:=True, AllowMultiple
:=True)> _
8 Public Class Annotation
9 Inherits System
.Attribute
11 Protected strAuthor
As String
12 Protected strComment
As String
14 Public Sub New(ByVal Author
As String, ByVal Comment
As String)
19 Public Property Author() As String
25 strAuthor
= CStr(Value
)
29 Public Property Comment() As String
34 strComment
= CStr(Value
)
40 <Annotation("mr-", "AttributeTest")> _
41 Public Class TestClass
42 Public Sub New(a
As integer,b
As integer,c
As integer)
46 Public Sub SayWhoYouAre()
51 Public Class TestClass2
52 Public Sub New(a
As integer,b
As integer,c
As integer)
56 Public Sub SayWhoYouAre()
68 Dim MyAnnotation
As Annotation
70 tc
= New TestClass(2,3,4)
71 tc_type
= tc
.GetType()
72 obj
= tc_type
.GetCustomAttributes(False)
73 MyAnnotation
= CType(obj(0), Annotation
)
75 Console
.WriteLine(TestUtils
.GenerateHash(MyAnnotation
.Author
& MyAnnotation
.Comment
))