G
Grok
In writing a class library, one of the classes should only ever be
instantiated once, and its object should be accessible to every other
class in the library. How can I do that?
To provide some actual names for discussion, I'm trying to do this
with a custom log-writing class, named LogWriter.vb. So I would like
to declare ..
Class library project:
LogWriter.vb
Drives.vb
Folders.vb
Files.vb
Friend Logger As LogWriter = new LogWriter(LogFilename)
and have Drivers, Folders, and Files classes all be able to use the
sole instantiation "Logger" in their code.
Hints on how to organize this properly?
instantiated once, and its object should be accessible to every other
class in the library. How can I do that?
To provide some actual names for discussion, I'm trying to do this
with a custom log-writing class, named LogWriter.vb. So I would like
to declare ..
Class library project:
LogWriter.vb
Drives.vb
Folders.vb
Files.vb
Friend Logger As LogWriter = new LogWriter(LogFilename)
and have Drivers, Folders, and Files classes all be able to use the
sole instantiation "Logger" in their code.
Hints on how to organize this properly?