
Create a Macro #51
Chapter 6, Speed Hacks
|
201
HACK
Dictionary.Remove(carID);
}
}
}
I am showing only the first class generated for brevity’s sake. As you might
imagine, the second class is exactly the same except for a different class
name. You can modify the XML file and add additional property sets, or you
can modify the template and the custom tool will always keep your code up-
to-date.
CodeSmith is an extremely valuable tool, and I encourage you to explore it
further. More information can be found at the home page for CodeSmith,
which is at http://www.ericjsmith.NET/codesmith.
HACK
#51
Create a Macro Hack #51
Learn how to create and run macros that automate mundane development
activities.
Creating a macro to help you with your daily tasks is an excellent way to
automate and improve repetitive operations. There are several ways to cre-
ate a macro: either recording your actions in the IDE or creating a macro
from scratch. After you have your macro built and tested, you can also cre-
ate a toolbar button that launches your macro or create a keyboard shortcut.
Recording Macros
The quickest way to automate simple macros is by recording your interac-
tions with the IDE. To activate the macro recorder, go to Tools
➝ Macros
➝ Record TemporaryMacro. This will start the macro recorder. From this
point until you stop the recording, your interactions with the IDE will cre-
ate code in the new macro. You can pause ...