Home
Manage Your Code
Snippet: Singleton pattern (C#)
Title: Singleton pattern Language: C#
Description: This is a typical singleton pattern Views: 706
Author: Sam Dela Cruz Date Added: 12/7/2007
Copy Code  
1public class Email
2{
3    protected static Email instance;
4
5    public Email()
6    {
7    }
8
9    public static Email Instance
10    {
11        get
12        {
13            if (instance == null)
14            {
15                instance = new Email();
16            }
17            return instance;
18        }
19    }
20}