问题描述
Visual Studio中的查找所有引用功能很好地工作寻找一个属性引用,因为它发生了调用层次结构这是否太 - 它甚至更好,其实,它调用的方法对其进行排序。
Visual Studio's "Find All References" function works nicely for finding references to a property, and as it happens the "Call Hierarchy" does this too - it's even better in fact, as it sorts them by calling method.
不过我的问题是,这些方法都不setter和getter区分,所以我减少到使用find-在文件属性名=。
My problem however is that neither of these methods discriminate between the setter and getter, and so I'm reduced to using find-in-files for "PropertyName =".
这似乎是一种倒退(使用属性名+ =价值或类似显然找不到代码),所以如果我已经错过了简单的我想知道说服Visual Studio中的调用层次结构的函数,在属性setter工作或专门吸气剂的方法是什么?
That seems like a step backwards (and would obviously not find code using "PropertyName += value" or similar), so I was wondering if I'd missed a simple way of persuading the "Call Hierarchy" function of Visual Studio to work on a property setter or getter specifically?
推荐答案
ReSharper的可以做你们能这样:
Resharper can do that for you.
无R#,一种方法是到即暂时设定二传手私人和重新编译。这将使无处不在你想设置一个错误。不漂亮,但比我能想到的任何其他方法更快。
Without R#, one way would be to temporarly set the setter to private and recompile. That will give an error everywhere you're trying to set. Not pretty, but faster than any other method I can think of.
这篇关于是否有一个(更好)的方式找到一个属性的setter的所有引用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!