Dec 22nd, 2008 | No Comments

Task list comments are a great way to remind you or others of something that still needs to be done or something that may need to be revisited for enhancement.

The task list (Ctrl-Alt-K/View.TaskList) is a handy tool that is most often used to view errors or warnings from the compilation of your code.

The task list also has another use; it can be used to leave reminders for yourself or other members of your team in comment form.

You can use this comment anywhere throughout your code, and they will show up in the task list when the file with the comment is open.

//

// TODO: Add addition logic here

//

To list this in your task list first make sure that the task list is configured to show comments, and then you will see in the task list that this comment has been added as an item.

You will see a drop-down list at the top of the task list that lets you choose what should be displayed in the task list.

You can then click on this comment and be taken to the place where you need to add code.

You can use shortcuts to step back and forth between tasks as well. The View.NextTask ( Ctrl-Shift-F12) and View.PreviousTask (no default shortcut) commands can be used to step through the tasks listed in the task list.

You can also click in the area at the top of the task list with the text “Click here to add a new task,” or  you can click the Create User Task button. This creates a user task for you and acts much like the tasks portion of Outlook. You can also tag any line in your project as a task by using the Edit.ToggleTaskListShortcut (Ctrl-K, Ctrl-H) command. Whenever you call this command, it will add a shortcut to the task list pointing to this line of code. You can then add text that says what should be done to the line of code. It is a quick and easy way to add something to the task list to tackle later on. These tasks will appear only on your system and not on the systems of your team members.

Dec 15th, 2008 | No Comments

There are a few hidden gems in Visual Studio that are easy to overlook. One of those is the Code Definition Window (ctrl+\,ctrl+d or View – Code Definition Window).

The Code Definition Window will work in two different ways. The first is with your current code editing window. As you navigate your code, the Code Definition Window will display the definition of the objects currently under your cursor. For instance, if your cursor is currently over a class level variable, the Code Definition Window will display the location in the source file where the variable is declared. The same goes for methods and classes both within the current source file and in other source files within your current solution.

The second way the Code Definition Window can work is in conjunction with the Visual Studio Class View Window (ctrl+shift+c or View – Class View). The Class View Window is a handy tool window in its own right, giving a quick overview of the object model of the current solution and allowing fast navigation through namespaces, classes, and methods. If you double click on a method in the Class View Window, Visual Studio will open the appropriate source code file and scroll to that particular method. This is quite useful for larger projects and for projects that might have multiple class definitions in each file. However, if you single click on a method, the contents of that method will show in the Code Definition Window without opening the file in a text editing window.

codeview

Page 4 of 6« First23456