Click here to Skip to main content
15,895,423 members

Comments by Member 9862872 (Top 5 by date)

Member 9862872 10-Jun-13 8:59am View    
Excellent work; thanks lukeer, this works great. I'm surprised there isn't a more direct method available but I guess this only adds a couple of extra lines of code. Many thanks..
Member 9862872 7-Jun-13 9:43am View    
Thanks Lukeer, Yes, this would be a non-issue if it was a Windows Forms Application but unfortunately this isn't possible in this instance.
Member 9862872 18-Apr-13 5:38am View    
Many thanks tumbledDown2earth, I have implemented your solution (at least similar) and it works great. I guess you hadn't intended the "new Logger / new Thread" to be in the constructor; I had a look at the singleton pattern link you provided and it all become clear. I did it like this:
public static Logger CurrentLogger()
{
if (_logger == null)
{
lock (locker)
{
if (_logger == null)
{
_logger = new Logger();
Thread loggerThread = new System.Threading.Thread(new System.Threading.ThreadStart(_logger.Initialise));
loggerThread.Start();
}
}
}
return _logger;
}
Member 9862872 17-Apr-13 11:33am View    
How do instantiate it without it entering an infinate loop ?
Member 9862872 18-Mar-13 10:41am View    
Ok Sergey, i'll add some more info. Yes you're right, I'm still very much learning as I go OO wise.