473,394 Members | 1,866 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Finding out by reflection what interfaces a class implements


I would like to browse all the classes in an assembly and see which
implement a certain interface. Is there a way to do this? I know how to
get an array of types in an assembly, but can't see how to take the next
step.

Nov 17 '05 #1
2 1472
Terentius,

Once you have a Type instance, you can call the GetInterfaces method on
the Type and it will return an array of interface types that the type
implements.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Terentius Neo" <te***********@here.fi> wrote in message
news:r4***************@read3.inet.fi...

I would like to browse all the classes in an assembly and see which
implement a certain interface. Is there a way to do this? I know how to
get an array of types in an assembly, but can't see how to take the next
step.

Nov 17 '05 #2
Nicholas Paldino [.NET/C# MVP] wrote:
Terentius,

Once you have a Type instance, you can call the GetInterfaces method on
the Type and it will return an array of interface types that the type
implements.

Hope this helps.


Of course! So simple... Thanks

TN
Nov 17 '05 #3

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

Similar topics

3
by: Cezar | last post by:
Hello, Can anyone please help me with this matter. I try to find the interfaces implemented by a class using Reflection. e.g: public class A : InterfaceB, InterfaceC how can I get (the...
12
by: Antony | last post by:
Hello - I am wanting to print out a "Yes" next to classes that implement "Interface01", otherwise a "No". Here is my code. It crashes with a null reference exception and I am not sure why. Ideas?...
8
by: Rlrcstr | last post by:
If I have some code behind a form and I want to be able to pass an object to it... any of several user defined classes that I have... and then display the values in the member variables of the...
5
by: | last post by:
I am having problems with casting or converting a class to to an interface from which it derives. I'm certain that it's due to how it's being loaded, but I'm not sure how to get past the problem....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...

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.