July 2015
Intermediate to advanced
1300 pages
87h 27m
English
Code snippets .snippet files are XML files containing the code and information about the snippet. Code snippets have their own XML schema that Visual Studio then uses to correctly identify them within the IDE. To understand how a code snippet is made, consider the following code that is stored in the snippet named Calculate Cosine of an Angle from the Visual Studio snippets library:
Dim radians As Double = 120 * Math.PI / 180Dim cos As Double = Math.Cos(radians)
If you open the CalculateCosineOfAngle.snippet file with an XML editor (or just with Windows Notepad), the file content looks like the content of Listing 52.1.
LISTING 52.1 Examining an Existing Code Snippet