The purpose of this 'application' is to simply provide a simplified method for handling and reporting Exceptions during the writing, debugging, and testing processess. I quoted application because it's not a full application but a simple code source file I'm writing for my own utility purposes that I will import into future projects.
I've found over time (not a lot, I'm an inexperienced programmer) that in all applications I code, I tend to handle Exceptions the same way depending on the phase of development.
What I've decided to do is provide myself with a new way to get the same function with fewer lines of code and fewer changes during phase transitions.
The new class works something like this (quick demo);
Code:
//At the beginning of application, create ExceptionManager object
ExceptionManagement.ExceptionManager emDumpToEmail = new ExceptionManagement.ExceptionManager;
emDumpToEmail.Destination = Destination.Email;
//specify any unique email attributes
emDumpToEmail.EmailTo = "someguy@microsuft.com";
try
{
//bad stuff goes down here
}
catch (Exception Ex)
{
emDumpToEmail(Ex);
}
In that example, it would be for a beta testing program aiding me in gathering debug information.
I was going to create likewise functions for writing to the console, a web service, a local text file, or into a database.
The idea is to only have to change one block of code for each phase of the development (the initial configuration of the object upon creation) and to be able to create multiple Exception handling objects configured for different uses.
Jeff W.
MCSE, CNE