updated test.sources
[mono.git] / mcs / btests / AttributesD.vb
1 Imports System\r
2 \r
3 <AttributeUsage(AttributeTargets.All, AllowMultiple:=True, Inherited:=True)> _\r
4 Public Class AuthorAttribute \r
5      Inherits Attribute\r
6         Public Name\r
7         Public Sub New(ByVal Name As String)\r
8                 Me.Name=Name\r
9         End Sub \r
10         \r
11 End Class\r
12 \r
13 \r
14 <Author("Robin Cook"),Author("Authur Haily")> _\r
15 Public Class C1\r
16         \r
17 End Class\r
18 \r
19 Module Test\r
20         Sub Main()\r
21 \r
22                 Dim type As Type=GetType(C2)\r
23                 Dim arr As Object()=type.GetCustomAttributes(GetType(AuthorAttribute),True)\r
24                 If arr.Length=0 Then\r
25                         Console.WriteLine("Interface has no attributes")\r
26                 Else\r
27                         Throw New Exception("AttributesC:Failed-Interfaces should not inherit attributes")\r
28                 End If\r
29         End Sub\r
30 End Module\r