About Code Insight

Code Insight is a real timesaver at the keyboard. It helps you zero in on types and their members while writing code. Knowing how to use this valuable capability will help you blaze through algorithms much faster than you can when using a plain text editor.

To get started with Code Insight, move to a blank line and press Ctrl+Spacebar in the editor to bring up a list of types to enter, as shown in Figure 1.11. Each character you type will filter the remaining options, making it quick and easy to select the item you want.

Figure 1.11. Code Insight in action.

graphics/01fig11.jpg

For example, if you are entering a Console.WriteLine command, press Ctrl+Spacebar and start typing Console. By the time you have typed "Cons", Console should appear as the top item in the list. Pressing the Enter key will complete the word. Pressing a period will also complete the word, type the period, and continue with Code Insight. When you press the period, as in Console., pressing the letter "w" will display "WriteLine" at the top of the list. Just press the Enter key or, better yet, press the left parenthesis key to continue editing with Code Insight. Pressing the left parenthesis key shows all the overloads for the WriteLine method. Code Insight is there to help every step of the way, making coding quick and easy.

Another Code Insight option can be seen by moving to a blank line and pressing Ctrl+J, which causes a list of common code snippets to appear, as shown in Figure 1.12. Typing a character will scroll the list to the first entry with that letter. Press the up and down arrow keys to traverse the list. When an item is selected, the entire block of code is copied into the editor. Be sure to add the code where it makes sense. For example, you wouldn't want to add a class declaration into the middle of a method.

Figure 1.12. Code Insight snippets.

graphics/01fig12.jpg



C# Builder KickStart
C# Builder KickStart
ISBN: 672325896
EAN: N/A
Year: 2003
Pages: 165

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net