|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
singletonHi
I would like to implement a Systemwide singleton in .net. Is it sensible to use a mutex for this? The application only can be run by one user at the time. Does anyone have any articles/samples that can help me with this problem? thanks N Hello Nick,
Seems that u mix it up a liitle bit Singleton allows you to create only one instance of the specific class: http://dofactory.com/Patterns/PatternSingleton.aspx If you want to have to start the single copy of the application you need to use global mutex: http://msdn2.microsoft.com/en-us/library/system.threading.mutex.aspx --- WBR, Michael Nemtsev [.NET/C# MVP]. My blog: http://spaces.live.com/laflour Team blog: http://devkids.blogspot.com/ "The greatest danger for most of us is not that our aim is too high and we miss it, but that it is too low and we reach it" (c) Michelangelo NC> would like to implement a Systemwide singleton in .net. Is it NC> sensible to use a mutex for this? The application only can be run by NC> one user at the time. Does anyone have any articles/samples that can NC> help me with this problem? NC> |
|||||||||||||||||||||||