First, you will want to create a separate Class Library project for your
LogMessage class, so that it can be used in any Solution of another project,
and when you're finished, add that project to your application's Solution.
Create the LogMessage class in such a way that it does not need to know
anything about the client using it. This can be done by exposing properties
and methods that a client class can work with.
In order for your Form to be updated from the LogMessage class, you will
want to add Events to the LogMessage class that the client class can
subscribe to.
--
HTH,
Kevin Spencer
Microsoft MVP
Chicken Salad Shooter
http://unclechutney.blogspot.com
A man, a plan, a canal, a palindrome that has.. oh, never mind.
"SoxFan44" <so****@44.netwrote in message
news:u2**************@TK2MSFTNGP04.phx.gbl...
I'm pertty new to designing software, so I have what's probably a very
simple question. I'm designing a Windows Forms application in C#. I have
a class LogMessage that will hold a single log message. I am creating a
Logger class where the constructor will take in a LogMessage and log it to
a file and update a Windows Form.
My question is, should Logger be a static class? And in what
file/function should I create the Logger instance so that it's accessible
from all forms and other classes? Thanks for the help!