J
Jeremy
Hi all,
This is driving me crazy: I am trying to get the name of a child class from
a parent class - the catch is that it's in a shared method. Here is what I
have so far:
Public Class Parent
Public Shared Sub Foo()
' I need to get the child name here, but
' since I can't use the "Me" keyword
' i am having problems
'// This fails because of "Me"
Dim ClassName as String = Me.GetType.Name
End Sub
Public Sub NonSharedMethod( )
'In a non-shared method, here is how I would do it:
Dim ClassName as String = Me.GetType.Name
End Sub
End Class
Public Class Child : Inherits Parent
Public Shared Sub bar( )
Call Foo( )
End Sub
End Class
Thanks,
Jeremy
This is driving me crazy: I am trying to get the name of a child class from
a parent class - the catch is that it's in a shared method. Here is what I
have so far:
Public Class Parent
Public Shared Sub Foo()
' I need to get the child name here, but
' since I can't use the "Me" keyword
' i am having problems
'// This fails because of "Me"
Dim ClassName as String = Me.GetType.Name
End Sub
Public Sub NonSharedMethod( )
'In a non-shared method, here is how I would do it:
Dim ClassName as String = Me.GetType.Name
End Sub
End Class
Public Class Child : Inherits Parent
Public Shared Sub bar( )
Call Foo( )
End Sub
End Class
Thanks,
Jeremy