I like to have a lot of assertions in my code, to help me with my assumptions. So I am a heavy user of the System.Diagnostics namespace. What I feel painful though, is the typing of System.Diagnostics.Debug.Assert(). No problem, I thought, I could just use a using statement. After creating a lot of classes, I started wondering why I cannot insert a using System.Diagnostics similar to how Visual Studio inserts a using System for C# classes.
Visual Studio handles this by using a template file. When a class file is added, it is done so by looking up a template on disk. That means, yes, we can add our own custom templates resulting in custom classes, reducing the drudgery of coding business layers. However, for the simple needs of this tip, we need to just add a using statement.
For the C# language:
For the VB language:
Now return to Visual Studio and insert a new class and notice how it inserts the using or imports statement in the new file by default.
Thank you! Thank you! I just finished reading this document, which was part of a link in the recent Buzz newsletter. I have printed it for others to read, especially those skeptical on the powers of Access and its capabilities.
Darren D.
All Our Microsoft Access Products