Go to implemented method rather than interface

后端 未结 5 1152
礼貌的吻别
礼貌的吻别 2021-02-14 13:24

Oftentimes when browsing code, I\'ll come across something like this:

public class Fruity
{
    private IOrange _Orange;

    public Fruity()
    {
        _Oran         


        
5条回答
  •  情深已故
    2021-02-14 14:02

    Of course already exists in Visual Studio ! It is there since ever.

    Right click on your code (Ex: property) an select "View Call Hierarchy". In Call Hierarchy window select the Implements folder.

    There you are. Why Resharper ??? Of course is not that complex as go to implementation from resharper which allows direct interrogation on interface, but only a property, or a method from that interface should be enough. Ex:

    public interface IModule
    {
    int Count { get; set; }
    }
    
    public class Module : Imodule
    { 
      public int Count {get; set;}
    }
    
    public class Module2 : Imodule
    { 
       public int Count {get; set;}  
    }
    

    Right click on the Count property (anywhere - inside the class or inside the interface) and select "View Call Hierarchy", should say which class implements it, and therefore the whole Interface.

    At the beginning we all love Resharper, with time, we all hate it !

提交回复
热议问题