visual-studio-2012 - Visual Studio : How to find all calls to function

标签 visual-studio-2012

下面对函数 B:Bla 有两次调用,但查看调用层次结构 (Cntl-K Cntl-T),然后对 A:Bla 和 B:Bla 中的每一个进行“调用”,结果表明一个调用将转到 A一个电话打给 B。

我正在处理一个非常大的代码库,有时我想要对一个函数的所有调用,但我不想为继承链中的每个函数单击“调用”。因此,对于下面的示例,无论我是在 A:Bla 还是 B:Bla 上调用它,我都希望“Calls to”返回两个调用。

using System;

class A
{
    public virtual int Bla() {
        return 65;
    }
}

class B : A
{
    public override int Bla()
    {
        return 66;
    }

    int Helper()
    {
        return this.Bla();
    }

    static void Main()
    {
        A obj = new B();
        Console.WriteLine(obj.Bla());
        Console.Read();
    }
}

最佳答案

您可以使用“查找所有引用”功能,突出显示有问题的方法并按 Ctrl + F12,或右键单击并选择“查找所有引用”。

这将在 Find Symbol Results 窗口中显示结果。

请参阅此链接以获取更多详细信息。 http://www.blackwasp.co.uk/VSFindAllReferences.aspx

关于visual-studio-2012 - Visual Studio : How to find all calls to function,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17497283/

相关文章:

c++ - MSVC 11 支持 std::thread 吗?

visual-studio - 为什么 GitHub 有时会忽略我的 Visual Studio 文件?

c++ - 为什么在 Release模式下可以在调试器中监视部分变量?

c - 使用 MinGW 构建依赖于 Visual Studio CRT (msvcr110.dll) 而非 Windows CRT (msvcrt.dll) 的 Windows DLL

c# - mysql.data.entity.mysqlconnectionfactory.createconnection(System.String) : overriding method must match the security accessibility

visual-studio-2012 - 是否可以在 Visual Studio 数据库项目中创建计算列?

c# - Oracle 数据库 TNS 键 'data source' 的值长度超出了它的限制 '128'

https - 在 VS2012 和团队中使用 IIS Express SSL 时遇到问题

visual-studio-2012 - 如何设置 Microsoft Help Viewer 2 的内容位置?

visual-studio-2012 - VS2012 pubxml 和 TransformWebConfigEnabled