簡體   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