15,895,423 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
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.