2 REM ExpectedError: BC32035
3 REM ErrorMessage: Attribute specifier is not a complete statement. Use a line continuation to apply the attribute to the following statement.
7 <AttributeUsage(AttributeTargets
.All
)> _
8 Public Class AuthorAttribute
11 Public Sub New(ByVal Name
As String)
17 <Author("Robin Cook")> _
26 Dim type As Type=GetType(C1
)
27 Dim arr
As Object()=type.GetCustomAttributes(GetType(AuthorAttribute
),True)
29 Console
.WriteLine("Class has no attributes")
31 Dim aa
As AuthorAttribute
=CType(arr(0),AuthorAttribute
)
32 Console
.WriteLine("Name:" & aa
.Name
)