Identifying Generic Types

kkemerait

Member
Joined
Aug 30, 2008
Messages
10
Location
Underhill, VT
Programming Experience
10+
Is there an alternative way to identify within a generic method the type that was passed in (of T) without having to create a bogus object and check typename?

Public Shared Function Create(Of T)() As iManager(Of T)

Dim BogusVar as T -- don't want to do it this way if possible to avoid

Select Case TypeName(BogusVar)

Case ("iSomeInterface")...


Thanks!
 

JohnH

VB.NET Forum Moderator
Staff member
Joined
Dec 17, 2005
Messages
15,583
Location
Norway
Programming Experience
10+
GetType(T)
 

kkemerait

Member
Joined
Aug 30, 2008
Messages
10
Location
Underhill, VT
Programming Experience
10+
wow

ok, I need to go out and mow the grass or something ... not a good day for programming ... I tried everything in the universe but ... the simple solution never occured to me ... feelin kinda foolish now ... thanks for the assist!!

:)
 
Top Bottom