简体   繁体   English

我如何查看打开的文档?

[英]How do I see which documents are open?

This may seem like a stupid question but bear with me. 这似乎是一个愚蠢的问题,但请允许我。

So I am using Microsoft Visual Web Developer 2010 Express (because it's free and was recommended to me), and I am using the 'Find and replace' tool a lot to change variable names and so on. 因此,我使用的是Microsoft Visual Web Developer 2010 Express (因为它是免费的,建议向我推荐),并且我经常使用“查找和替换”工具来更改变量名,等等。 On the top I can have 2 documents open "Test.aspx" and "Test.aspx.cs" and I want to change the varible name "Auction" to "AuctionID" for example. 在顶部,我可以打开2个文档“ Test.aspx”“ Test.aspx.cs” ,例如,我想将变量名称“ Auction”更改为“ AuctionID”。 I put in replace all in the currently open documents. 我在当前打开的文档中全部替换了。 This, for some reason, changes the names in another file - let's call it "Test2.aspx " for some reason even though I can not see that I have it up. 由于某种原因,这会更改另一个文件中的名称-出于某种原因,即使我看不到我已经将其命名“ Test2.aspx ”。 And I click it down and try again - same thing. 然后单击它,然后重试-同样的事情。

Is there any way to close all of them and only open the ones I want again? 有什么办法可以关闭所有这些,然后只重新打开我想要的那些吗? Or is this just some weird bug? 还是这只是一些怪异的错误?

Thanks in advance. 提前致谢。

It should be tabs within your visual studio. 它应该是Visual Studio中的选项卡。 Every time you have one open, it should show it as another tab you can switch through, but I know I have made mistakes using the find and replace with 'All Opened Document's' selected, so I would recommend just using "Current Document" instead, which will just search the current document you are working in. 每次打开一个文件夹时,它都应该显示为可以切换的另一个选项卡,但是我知道我使用“查找并替换为选中的“所有打开的文档””时会出错,因此建议您改用“当前文档” ,它将仅搜索您正在使用的当前文档。

The Find & Replace window has several options for the scope of your replacement. “查找和替换”窗口具有多个用于替换范围的选项。

  • Current Document (only if you have a document open) 当前文档 (仅当您打开文档时)
  • All Open Documents (only if you have more than one document open) 所有打开的文档 (仅当您打开了多个文档时)
  • Current Project (only if you have a current project open) 当前项目 (仅当您打开了当前项目时)
  • Current Solution 当前解决方案
  • Selection (only if you have a block of text currently highlighted in the editor) 选择 (仅当您当前在编辑器中突出显示文本块时)

You'll see this as a dropdown menu under the option for "Look In" when viewing the Find/Replace window ( Control + F ). 查看“查找/替换”窗口( Control + F )时,将在“查找”选项下将其作为下拉菜单。

查找/替换窗口

By the way, are you actually trying to rename a variable or type name (as opposed to random text)? 顺便说一句,您实际上是在尝试重命名变量或类型名称(与随机文本相对)吗? The best way to do that is to right click the variable or type name, then go into Refactor, then Rename. 最好的方法是右键单击变量或类型名称,然后依次进入“重构”和“重命名”。 It will "know" where the variable/type is being referenced and replace all references to it. 它会“知道”变量/类型的引用位置,并替换所有对其的引用。

Below the replace textbox, there is a combobox with these options: 在替换文本框下面,有一个带有以下选项的组合框:

Current Document
All Open Documents
Current Project
Entire Solution 
Selection //this is added when there is a selection

Before hitting Replace All button choose the option that fits you. 在点击全部替换按钮之前,选择适合您的选项。

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

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