|
Partner
|
|
|
singp (Singleton Pattern)
Beschreibung:
Snippet for singleton pattern. Inserts a region with singleton functionality into a existing class. The class instance can be accessed through the static property "Instance".
Abgelegt unter: Singleton Pattern, Pattern, Visual Studio 2005, Visual Studio, Singleton.
|
| C# |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#region Singleton Pattern
static $classname$ instance = null;
private $classname$() { }
public static $classname$ Instance
{
get
{
if (instance == null) {
instance = new $classname$();
}
return instance;
}
}
#endregion
|
|
Kommentare:
(Zum Schreiben von Kommentaren bitte anmelden.)
|
Thorsten Hans schrieb am:
19.09.2007 23:39:17
|
|
Diese Snippets könnten für Sie interessant sein:
|
|
|
|
|
|
|
|
|