Tuesday, April 18, 2006
Note that my blog has moved to http://www.pksoftware.net/devblog/.

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.

Tuesday, April 18, 2006 11:09:33 PM (GMT Standard Time, UTC+00:00) |  | #
Note that my blog has moved to http://www.pksoftware.net/devblog/.
Search
Links
My blog has moved to http://www.pksoftware.net/devblog/
Products
Mini SQL Query
Mini SQL Query is a minimalist SQL query tool for multiple providers (MSSQL, Oracle, OLEDB, MS Access files etc.)

Verse Popper
The "Verse Popper" displays bible verses periodically in the lower right hand corner of your screen.

Blogroll
My blog has moved to http://www.pksoftware.net/devblog/