繁体   English   中英

在当前类中的游标下找到接口的实现

[英]Find implementation of interface under cursor in current class

这个问题的版本略有不同,似乎无法解决我的问题,F12 / Ctrl-F12并不是我想要的。

在编辑实现了在别处定义的接口的大型类时,我想跳转到文件中实现接口功能的所有位置:

class VeryLargeClass : IInterfaceInOtherFile
{
  // lots of code

  // ..... I want to jump here
  public FirstFunctionOfIInterfaceInOtherFile() {}

  // more code

  // ..... then I want to jump here
  public SecondFunctionOfIInterfaceInOtherFile() {}
}

假设光标位于IInterfaceInOtherFile我想在当前文件中IInterfaceInOtherFile实现IInterfaceInOtherFile所有位置。

另一种选择是在ClassView中显示模式,在该模式下,我可以查看类中的函数是已实现的接口,从基类覆盖还是特定于该类。

有可能,也许有一个插件?

在Visual Studio 2017中(未在其他版本中进行测试),可以按Ctrl - F12或右键单击接口名称,然后选择“转到实现”。 如果有多个实施,您将获得一系列实施选择。

接口的各个属性和方法存在相同的机制。

请注意,从实现(或其他任何位置)中,可以使用F12或通过上下文菜单“转到定义”。 使用Alt - F12 (或上下文菜单)可以“窥视定义”。 从那里开始,然后您可以转到实现。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM