PC Review


Reply
Thread Tools Rate Thread

derived classes via reflection

 
 
larmue
Guest
Posts: n/a
 
      25th Jul 2006
Hi !

Is there a way to get the names of all classes derived from a baseclass
? I haven't found anything obvious in the API documentation so far.

Thanks
Lars

 
Reply With Quote
 
 
 
 
Paul E Collins
Guest
Posts: n/a
 
      25th Jul 2006
larmue wrote:

> Is there a way to get the names of all classes
> derived from a baseclass ? I haven't found
> anything obvious in the API documentation


It may not be the most efficient way, but you can iterate over all the
types (classes) in your assembly and test Type.IsSubclassOf for each
one.

Eq.


 
Reply With Quote
 
Hitesh Ramchandani
Guest
Posts: n/a
 
      25th Jul 2006
Lars, Would you like to get the names of all classes derived from a base
class at a particular point in time?

If so that could be achieved by modifying the architecture to include a
factory class responsible for the creation of the classes of the type base
and/or have a collection in the factory class to store the TypeOf
information about each derived class while it is being instantiated.

All the derived classes of the type base should be created through this
factory class.

-H

"larmue" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi !
>
> Is there a way to get the names of all classes derived from a baseclass
> ? I haven't found anything obvious in the API documentation so far.
>
> Thanks
> Lars
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MemberInfo derived classes Tony Johansson Microsoft C# .NET 1 14th May 2010 10:53 AM
Custom Attributes, Shared methods, Derived classes and reflection Jeff Mason Microsoft VB .NET 15 1st Aug 2006 05:37 PM
Newbie on Inheritance, Base classes and derived classes aaj Microsoft C# .NET 2 21st Jun 2005 03:52 PM
Events in Derived Classes =?Utf-8?B?UmVNRW4=?= Microsoft Dot NET 0 9th Mar 2005 12:15 AM
Serialization and derived classes StuartM Microsoft C# .NET 3 10th Nov 2004 01:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:33 PM.