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

前端 未结 2 864
情歌与酒
情歌与酒 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.

    0 讨论(0)
  • 2020-12-21 12:34

    Using ReSharper, right-click on the Interface, go to Implementation, choose the one you want to see from the list it populates.

    I don't think there's a way to do it programatically, but if you just mean in the IDE, this is the easiest way to do so.

    0 讨论(0)
提交回复
热议问题