You seem confused: the FilterableList class has methods, which are not associated with the generic parameter. To access CodeElement methods, you need to provide a constraint of what classes T can be:
Public Class FilterableList(Of T As CodeElement)
Inherits List(Of T)
...
Public Sub DoSomething(x As T)
x.MyMethod()
End Sub
End Class
I'm trying to reverse the GetType() function so I can access a static method - that's why I don't believe I need the instance.
GetType(CodeElement) returns its type; can I get that type's class and then access the methods in it?
For static methods, you don't need GetType
CodeElement.MyStaticMethod()
is all you need. You can access static (Shared in VB talk) methods directly via the class name, and even access the base class methods that way:
Public Class B
Public Shared Sub MyBaseMethod()
End Sub
End Class
Public Class D
Inherits B
Public Shared Sub MyMethod()
End Sub
End Class
Private Sub MyButton_Click(sender As Object, e As EventArgs)
B.MyBaseMethod()
D.MyBaseMethod()
D.MyMethod()
End Sub