How to find what class(es) implements an interface (.Net)

前端 未结 2 866
情歌与酒
情歌与酒 2020-12-21 12:06

The closest I could find to this question was this one: Getting all types that implement an interface

But that is for use in code, and to use it I\'d have to change

2条回答
  •  暖寄归人
    2020-12-21 12:27

    No there's not an easier way. I guess that way is pretty easy to do. It's just three lines. You can cache the results in a list or dictionary (in case you want to test it for a collection of interfaces) if you need to do it many times in a row.

    In case you need just as a tool, Reflector does it.

提交回复
热议问题