Consuming Code Snippets

Adding existing code snippets into your code is an easy task. Just for demo purposes, create a new console project with Visual Basic and, when ready, place the cursor within the Sub Main. Right-click and select the Insert Snippet command. At this point the IDE shows a list of available snippets categories, as shown in Figure 56.21.

Figure 56.21 The IDE shows a list of available snippets categories.

image

The first thing to mention is that code snippets files are organized in categories, such as WPF, Code Patterns, Fundamentals, and so on. Basically a category is nothing but a folder containing a number of .snippet files. Double-click ...

Get Visual Basic® 2010 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.