Visual Studio - 在隐藏代码中搜索对象使用情况的快速方法
在Visual Studio中,有没有一种快速的方法可以在后面的代码中搜索对象的用法? 这是我经常做的事情,而我目前的做法似乎有点笨拙。
我正在使用 VS2005、WinForms、VB 和 CodeRush/RefactorPro。
目前我执行以下步骤: 在设计视图中
- 单击对象。
- 在属性对话框中,双击对象的名称
- 将其复制到剪贴板(使用 Ctrl-C 或右键单击并选择复制)
- 按 F7 调出编辑器后面的代码
- 按 Ctrl-Home 定位到文件顶部。
- 按 Ctrl-F,将弹出查找对话框
- 按 Ctrl-V,将对象名称粘贴到“查找内容:”文本框中。
- 点击 ENTER 开始查找。
理想情况下,我想单击设计视图中的对象,然后按热键 执行这些其他步骤。
如果VS2005没有内置任何东西,我应该研究使用宏吗?
In Visual Studio, is there a quick way to search for an object's usage in the code behind?
This is something I do constantly and the way I am currently doing it seems a little clunky.
I am using VS2005, WinForms, VB and CodeRush/RefactorPro.
Currently I do the following steps:
In Design View
- Click the Object.
- In the Properties Dialog, double click the Name of the object
- Copy it to the clipboard (Using Ctrl-C or Right Click and selecting Copy)
- Press F7 to bring up the code behind editor
- Press Ctrl-Home to position to the top of the file.
- Press Ctrl-F, which brings up the Find Dialog
- Press Ctrl-V, to paste in the name of the object into the "Find what:" text box.
- Tap ENTER to start the Find.
Ideally, I would like to click the object in Design View then hit a hot key
to do these other steps.
If VS2005 does not have anything built in, should I research using a Macro?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我不知道类似的功能,内置的 Visual Studio,但是,您可以使用精彩的插件 JetBrains 的 Resharper 具有该功能以及许多其他出色的功能...
还有另一个名为 CodeRush,我没用过,但似乎值得一看。
I don't know about any functionality like that, built-in visual studio, however, you can use the wonderful plugin Resharper from JetBrains which has that functionality, as many other excellent features...
There is also another add-on called CodeRush, I haven't used it but it seems to be worth a look.
如果允许使用第 3 方插件,请安装 R# 并使用“查找用法”工具。尽管不确定 R# 是否仅仅为了这个功能就值得。
If 3rd party addons are allowed, install R# and use the Find Usages tool. Although not sure R# would be worth it just for this feature alone.
Tab 到下一个引用 - CodeRush 或 CodeRush Xpress
此功能允许您循环浏览对标识符的所有引用,只需将插入符号放在标识符中并点击 [TAB]
查找所有引用 - CodeRush
在 CodeRush 中使用 [Shift-F12] 组合将打开“引用”工具窗口,该窗口将显示当前插入符号处的标识符的所有引用。
Tab To Next Reference - CodeRush Or CodeRush Xpress
This feature allows you to cycle through all references to an identifier simply by placing your caret within the identifier and hitting [TAB]
Find All References - CodeRush
The use of the [Shift-F12] combo in CodeRush will bring up the References toolwindow which will then display all references to the identifier currently at the caret.