Opening Files

The more time you spend in the IDE, the more you’ll want to customize your experience. The same is true for opening files. Since this is a frequent activity, you’ll want shortcuts or some time-saving customizations to expedite getting your files opened where you want them.

Opening Files and Editor Windows

These next tips offer various customizations for opening a file in the editor.

Tip 2.22: How to reuse the same editor window when opening files

Go to Tools–Options–Environment–Documents, and check the Reuse Current Document Window, If Saved option to give this tip a try.

Tip 2.22: How to reuse the same editor window when opening files

If the current document window is dirty (meaning you’ve made a modification but haven’t saved it yet), the next document opens in its own document window. However, if the current document is saved, the new document just opens over it.

I tried using this from time to time when I owned testing it, but it wasn’t for me.

Tip 2.23: How to automatically refresh an open document in the editor

Under Tools–Options–Environment–Documents, there’s the option to Detect When A File Is Changed Outside The Environment. Under it is the second option, to Autoload Changes, If Saved.

If only the first check box is checked, you’ll get this prompt:

Sara Aside

If you do a lot of modifying of files outside Visual Studio, I could see this dialog box getting annoying. But since the option is global and sticky across Visual Studio sessions, I wouldn’t want to forget that I had it checked. But then again, this is coming from a very paranoid, risk-averse tester.

Tip 2.24: How to edit a read-only file in Visual Studio

In Tools–Options–Environment–Documents, there’s the option Allow Editing Of Read-Only Files; Warn When Attempt To Save.

If this option is checked (my personal preference) and you attempt to save, you’ll get prompted whether you want to overwrite the document or save it as something else. My thoughts are—if I’m editing the file, I want to overwrite it eventually.

Tip 2.24: How to edit a read-only file in Visual Studio

If this option isn’t checked and you attempt to edit the file, you’ll get prompted whether to make the file writeable or perform an in-memory edit.

Tip 2.24: How to edit a read-only file in Visual Studio

Tip 2.25: How to customize what directory the File–Open–File dialog box opens to

This tip is pretty straightforward. Under Tools–Options–Environment–Documents, there’s the Open File Using Directory Of Currently Active Document option. When I first read this option, it took me a few seconds to think, "What’s the open file thingy?" It’s referring to the File–Open–File dialog box.

If you have this option checked, you’ll open to the directory of the currently active document in the editor (the doc with the focus), as shown in the next image.

Tip 2.25: How to customize what directory the File–Open–File dialog box opens to

If you do not have this option checked, the File–Open–File dialog directory displays content as an MRU (most-recently used) list, opening to the last directory used to open a file.

Tip 2.26: How to customize the number of items shown in the Recent Files lists (and where to find those lists)

This tip explores the Recent Files options, found under Tools–Options–Environment–General.

Tip 2.26: How to customize the number of items shown in the Recent Files lists (and where to find those lists)

The Items Shown In Window Menu option controls the number of items to display in the Window menu. For example, if you set the option to 5, you will get only 5 items in the Window menu, as shown here:

Tip 2.26: How to customize the number of items shown in the Recent Files lists (and where to find those lists)

The Items Shown In Recently Used Lists controls the number of items found in the File–Recent Files and File–Recent Projects lists. When it is set to 3, you’ll see only 3 files in these lists, as shown here:

Tip 2.26: How to customize the number of items shown in the Recent Files lists (and where to find those lists)
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.239.226