A CodeSmith ActiveSnippet to create Resources.xml entries

I create a lot of resources.xml and controlpanelresources.xml entries.  Adding a Community Server resources file entry is not a time-consuming process, but the CodeSmith ActiveSnippet I created makes it even less time-consuming.  CodeSmith ActiveSnippets were introduced in CodeSmith 4.0 and are a lot like Visual Studio 2005 Snippets, but much more robust, with the full CodeSmith toolset at our disposal.  Another great thing about CodeSmith ActiveSnippets is that you can use them in places where you cannot use VS2005 Snippets, which are intellisense-driven.  With CodeSmith ActiveSnippets, you press Ctrl-E, Ctrl-E in any file, like in a Resources.xml file, and the snippet fires up.

My activesnippet’s alias is “csr.”  My resource entry consists of a resource name and value, which are passed as arguments on the line which will be expanded.  Below is what the new line looks like before it’s expanded.

Then with my cursor anywhere on that line, I enter Ctrl-E, Ctrl-E and my new resource entry is done.  Next.

The template is located here if you think you’d find it useful, too.

Article written by

A long time developer, I was an early adopter of Linux in the mid-90's for a few years until I entered corporate environments and worked with Microsoft technologies like ASP, then .NET. In 2008 I released Sueetie, an Online Community Platform built in .NET. In late 2012 I returned to my Linux roots and locked in on Java development. Much of my work is available on GitHub.