Snippets are cool, the most basic for of code generation. I have a bunch that I use for common tasks etc.
Normally I don't use the "mini" snippets, when I say mini I mean things like "if" or "foreach" etc. I find it quicker just to type stuff out... but today I realized that if you use the "switch" snippet and provide an enumeration as the "switch_on" arguement, the output actually renders all the enumeration cases for you - simple, but cool!
i.e - if "value" is of type "FormWindowState":
switch(value) [enter]
Renders:
switch (value)
{
case FormWindowState.Maximized:
break;
case FormWindowState.Minimized:
break;
case FormWindowState.Normal:
break;
default:
break;
}
Simple - but I like it! The snippet function that provides the functionality is "GenerateSwitchCases".
MSDN also has a whole bunch of snippets available for download http://msdn.microsoft.com/vstudio/downloads/codesnippets/default.aspx.