Imports System
Imports System.Reflection
Class MyMainClass
Shared Sub Main()
Dim moduleArray() As [Module]
moduleArray = [Assembly].GetExecutingAssembly().GetModules(False)
Dim myModule As [Module] = moduleArray(0)
Dim myType As Type
myType = myModule.GetType("MySimpleAttribute")
Console.WriteLine("IsDefined(MySimpleAttribute) = {0}", myModule.IsDefined(myType, False))
End Sub
End Class
_
Public Class MySimpleAttribute
Inherits Attribute
Private name As String
Public Sub New(ByVal newName As String)
name = newName
End Sub
End Class