
70
|
Chapter 2, Master the Editor
#15 Use and Share Code Snippets
HACK
C# Refactoring Tools
From dotnetrefactoring.com:
http://www.dotnetrefactoring.com
HACK
#15
Use and Share Code Snippets Hack #15
Tap into a whole universe of other people’s code and share some of your
own.
Visual Studio 2005 introduces a new feature called Code Snippets that
allows you to insert a piece of example code directly into the class you are
working with. At the time of this writing, this feature is available only for
Visual Basic.
Insert Code Snippets
You can quickly insert example pieces of code by right-clicking in the area
where you want to insert code, then clicking the Insert Snippet item on the
context menu that appears. A list of code categories appears, as shown in
Figure 2-39.
After you select the category Accessing Data, you will see the list of exam-
ples that you can automatically insert, as shown in Figure 2-40.
Figure 2-39. Code Snippet categories
Figure 2-40. Accessing Data example list