Click here to Skip to main content
15,887,135 members
Home / Discussions / C#
   

C#

 
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 
GeneralRe: recursively search the registry and delete text found. Pin
Derek Smigelski13-Nov-02 10:34
Derek Smigelski13-Nov-02 10:34 
GeneralRe: recursively search the registry and delete text found. Pin
Derek Smigelski13-Nov-02 10:41
Derek Smigelski13-Nov-02 10:41 
Generaltcpclient through proxy Pin
Kannan Kalyanaraman13-Nov-02 2:55
Kannan Kalyanaraman13-Nov-02 2:55 
GeneralOCX memory leak in C# Pin
gharrison12-Nov-02 21:29
gharrison12-Nov-02 21:29 
QuestionC# and Visual C#, Difference? Pin
Aisha Ikram12-Nov-02 21:16
Aisha Ikram12-Nov-02 21:16 
AnswerRe: C# and Visual C#, Difference? Pin
Sijin13-Nov-02 0:30
Sijin13-Nov-02 0:30 
GeneralRe: C# and Visual C#, Difference? Pin
Aisha Ikram14-Nov-02 18:08
Aisha Ikram14-Nov-02 18:08 
AnswerRe: C# and Visual C#, Difference? Pin
James T. Johnson13-Nov-02 4:01
James T. Johnson13-Nov-02 4:01 
GeneralRe: C# and Visual C#, Difference? Pin
Stephane Rodriguez.13-Nov-02 5:41
Stephane Rodriguez.13-Nov-02 5:41 

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.