シングルトンの実装
概要
シングルトンパターンでのユーザー定義クラスの作り方。
参照
前提条件
手順
手順というか、参照サイトのコード丸写し。
using System;
public class Singleton
{
private static Singleton instance;
private Singleton() {}
public static Singleton Instance
{
get
{
if (instance == null)
{
instance = new Singleton();
}
return instance;
}
}
}