There are many things that I do over and over each day that would make great candidates for automation. One of the first things that comes to mind is creating "regions" in my code. My company (and probably most that use regions) has some standards for our regions, for example Public Properties, Public Methods, Constants, Private Variables etc. One way of automating this task is to write an Add-In (or buy one) like our wondeful .NET Refactor. While this approach does the job very well, it's done after the fact and well, you may want to get creative in a way that we didn't provide. One of the easiest ways to accomplish this is to edit the Template for Add Class for instance:
Navigate to \Program Files\Visual Studio .NET 2003\VC#\VC#Wizards\CSharpAddClassWiz\Templates\1033\NewCSharpFile.cs. Open this up and edit away:
| using System; using System.Data; namespace [!output SAFE_NAMESPACE_NAME] { /// <summary> /// Summary description for [!output SAFE_CLASS_NAME]. /// public class [!output SAFE_CLASS_NAME] { public [!output SAFE_CLASS_NAME]() { // // TODO: Add constructor logic here // } #region Public Properties #endregion #region Public Methods #endregion #region Private/Protected Variables #endregion #region Constants #endregion } } |