May 2010
Intermediate to advanced
1272 pages
61h 18m
English
Code snippets .Snippet files are simply 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 / 180 Dim 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 56.1.
Listing 56.1 Examining an Existing Code Snippet
Code snippets in Visual ...
Read now
Unlock full access