Книга: C# 2008 Programmer
IntelliSense
IntelliSense
IntelliSense is one of the most useful tools in Visual Studio 2008. IntelliSense automatically detects the properties, methods, events, and so forth of an object as you type in the code editor. You do not need to remember the exact member names of an object because IntelliSense helps you by dynamically providing you with a list of relevant members as you enter your code.
For example, when you type the word Console
in the code editor followed by the .
, IntelliSense displays a list of relevant members pertaining to the Console
class (see Figure 2-41).
Figure 2-41
When you have selected the member you want to use, press the Tab key and IntelliSense will insert the member into your code.
IntelliSense in Visual Studio 2008 has some great enhancements. For example, the IntelliSense dropdown list often obscures the code that is behind when it pops up. You can now make the dropdown list disappear momentarily by pressing the Control key. Figure 2-42 shows the IntelliSense dropdown list blocking the code behind it (top) and having it be translucent by pressing the Control key (bottom).
Figure 2-42
You can also use IntelliSense to tidy up the namespaces at the top of your code. For example, you often import a lot of namespaces at the beginning of your code and some of them might not ever be used by your application. In Visual Studio 2008, you can select the namespaces, right-click, and select Organize Usings (see Figure 2-43).
Figure 2-43
Then you can choose to:
? Remove all unused using statements
? Sort the using statements alphabetically
? Remove all unused using statements and sort the remaining namespace alphabetically
- Code and Text Editor
- Code Snippets
- Implicit Typing
- Access Modifiers
- Understanding Namespaces and Assemblies
- Описание языка PascalABC.NET
- tell(X)
- Строго типизированные наборы данных
- Диалоговое окно ссылок
- Упрощенная регистрация событий в Visual Studio 2005
- Компиляция CIL-кода с помощью SharpDevelop
- Главная