Here is how you could create a custom code snippet using the visual studio "snippet" for snippet creation.
1. Open Visual studio (2005 or 2008).
2. Go to File -> New File (Ctr + N) -> choose Xml file and click "Open".
3. Ctr + K, Ctr + S and choose "Snippet" from the snippet drop down. This creates the skeletal xml for snippet creation.
4. Work on this template
Few interesting tags to be noted are:
1. $selected$ - this tag represents the text selected in the IDE by the user, before invoking the snippet. You could add snippet code above and/or below this tag.
1. $selected$ - this tag represents the text selected in the IDE by the user, before invoking the snippet. You could add snippet code above and/or below this tag.
2. $end$ - denotes the location where the carret will go after snippet replacement.