Click here to Skip to main content
15,916,835 members
Home / Discussions / C#
   

C#

 
GeneralRe: Locating directory ... not a file Pin
James T. Johnson13-Nov-02 11:01
James T. Johnson13-Nov-02 11:01 
GeneralRe: Locating directory ... not a file Pin
David Stone13-Nov-02 11:08
sitebuilderDavid Stone13-Nov-02 11:08 
GeneralRe: Locating directory ... not a file Pin
James T. Johnson13-Nov-02 14:00
James T. Johnson13-Nov-02 14:00 
GeneralRe: Locating directory ... not a file Pin
LongRange.Shooter14-Nov-02 4:23
LongRange.Shooter14-Nov-02 4:23 
QuestionInsertAt Bug??? Pin
Marc Clifton13-Nov-02 8:07
mvaMarc Clifton13-Nov-02 8:07 
AnswerRe: InsertAt Bug??? Pin
Marc Clifton13-Nov-02 8:11
mvaMarc Clifton13-Nov-02 8:11 
GeneralRe: InsertAt Bug??? Pin
leppie13-Nov-02 8:44
leppie13-Nov-02 8:44 
GeneralReal quick... Pin
CherezZaboro13-Nov-02 5:57
CherezZaboro13-Nov-02 5:57 
GeneralRe: Real quick... Pin
Martin Haesemeyer13-Nov-02 8:15
Martin Haesemeyer13-Nov-02 8:15 
GeneralRe: Real quick... Pin
leppie13-Nov-02 8:52
leppie13-Nov-02 8:52 
GeneralBuild .Net app, and take it to not .NET box. Receive error Pin
Derek Smigelski13-Nov-02 5:31
Derek Smigelski13-Nov-02 5:31 
GeneralRe: Build .Net app, and take it to not .NET box. Receive error Pin
Daniel Turini13-Nov-02 5:38
Daniel Turini13-Nov-02 5:38 
GeneralRe: Build .Net app, and take it to not .NET box. Receive error Pin
Bog13-Nov-02 11:33
Bog13-Nov-02 11:33 
GeneralRe: Build .Net app, and take it to not .NET box. Receive error Pin
Looney Tunezez3-Aug-04 12:45
Looney Tunezez3-Aug-04 12:45 
GeneralSingleton objects Pin
solidstore13-Nov-02 4:38
solidstore13-Nov-02 4:38 
GeneralRe: Singleton objects Pin
Marc Clifton13-Nov-02 8:14
mvaMarc Clifton13-Nov-02 8:14 
GeneralRe: Singleton objects Pin
Kevin McFarlane13-Nov-02 8:51
Kevin McFarlane13-Nov-02 8:51 
See this article:

Exploring the Singleton Design Pattern
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/singletondespatt.asp

The recommended solution, addressing all threading issues looks like this:

.NET Singleton Example
// .NET Singleton
sealed class Singleton 
{
    private Singleton() {}
    public static readonly Singleton Instance = new Singleton();
}

Sample Singleton Usage
sealed class SingletonCounter {
    public static readonly SingletonCounter Instance = 
         new SingletonCounter();
    private long Count = 0;
    private SingletonCounter() {}
    public long NextValue() {
        return ++Count;
    }
}

class SingletonClient {
    [STAThread]
    static void Main() {
        for (int i=0; i<20; i++) {
            Console.WriteLine("Next singleton value: {0}", 
                SingletonCounter.Instance.NextValue());
        }
    }
}



Kevin
GeneralRe: Singleton objects Pin
Sijin13-Nov-02 18:27
Sijin13-Nov-02 18:27 
Generalrecursively search the registry and delete text found. Pin
Derek Smigelski13-Nov-02 4:21
Derek Smigelski13-Nov-02 4:21 
GeneralRe: recursively search the registry and delete text found. Pin
Stephane Rodriguez.13-Nov-02 5:45
Stephane Rodriguez.13-Nov-02 5:45 
GeneralRe: recursively search the registry and delete text found. Pin
Derek Smigelski13-Nov-02 5:55
Derek Smigelski13-Nov-02 5:55 
GeneralRe: recursively search the registry and delete text found. Pin
leppie13-Nov-02 8:55
leppie13-Nov-02 8:55 
GeneralRe: recursively search the registry and delete text found. Pin
leppie13-Nov-02 8:59
leppie13-Nov-02 8:59 
GeneralRe: recursively search the registry and delete text found. Pin
Derek Smigelski13-Nov-02 9:00
Derek Smigelski13-Nov-02 9:00 
GeneralRe: recursively search the registry and delete text found. Pin
leppie13-Nov-02 9:44
leppie13-Nov-02 9:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.