473,480 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

derived classes via reflection

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

Jul 25 '06 #1
2 3840
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.
Jul 25 '06 #2
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" <la**********@gmx.comwrote in message
news:11*********************@b28g2000cwb.googlegro ups.com...
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

Jul 25 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2453
by: Edward Diener | last post by:
If I set an attribute on some part of a class, such as a property or event, does that attribute also apply to the same property or event of a derived class ? If the above is true, can I change...
5
2652
by: John Hardin | last post by:
All: Is it possible at runtime to determine the names of all classes derived from a given class? -- John Hardin KA7OHZ <johnh@aproposretail.com> Internal Systems...
5
4722
by: Dennis | last post by:
I have a class that inherits from DataGrid. I can set the rowheights in a DataGrid by tappig into the "get_Datagridrows" method. However, this does not work for classes that inherit from...
4
3329
by: Paul Wu | last post by:
Is there a way to constract a derived class that hides certain public members of a base class ? With the following code, a class that derives from DerivedClass can still see the member "Name" in the...
15
2115
by: Jeff Mason | last post by:
Hi, I'm having a reflection brain fog here, perhaps someone can set me on the right track. I'd like to define a custom attribute to be used in a class hierarchy. What I want to do is to...
26
5330
by: nyathancha | last post by:
Hi, How Do I create an instance of a derived class from an instance of a base class, essentially wrapping up an existing base class with some additional functionality. The reason I need this is...
1
2523
by: Stephen Walch | last post by:
Lets say I have designed my solution as a "base" assembly and a bunch of "implementation" assemblies. The goal is that I can add new implementation assemblies dynamically by declaring them in a...
3
2196
by: Goran Djuranovic | last post by:
Hi all, Is there a way to retrieve a derived class name inside a subroutine or a function of the base class? I am trying to get some data from the database, based on which derived class is calling...
2
4158
by: SimonDotException | last post by:
I am trying to use reflection in a property of a base type to inspect the properties of an instance of a type which is derived from that base type, when the properties can themselves be instances of...
0
7052
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6744
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6981
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5348
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4790
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4488
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1304
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
565
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
188
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.