TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Pete Burkindine
NA
4
0
Generics
Aug 14 2010 8:03 PM
Hi, all,
I have a class("Parent") that keeps a dictionary of items of another class("Child"). I am trying to make Child generic. This is in a base dll, with different implementations using the generic Child differently.
Please forgive the psuedocode...
I don't want to make Parent generic (this would mean making about a dozen other classes generic besides), but it needs to know the type to pass to the dictionary constructor:
Dictionary _d = New Dictionary(Of string, Child(of ____))
I could just use object, but that would defeat the purpose.
I was hoping something like:
Type _childType = (typeof constructorParam)
and then...
Dictionary _d = New Dictionary(Of string, Child(of _childType))
...would work. Instead, the compiler says 'Type _childType' is not defined.
I am hoping there is an easy way to do this. Thanks!
Reply
Answers (
0
)
CLR
Data grid view event