singleton
staticコンストラクタを使用する。 public class MySingleton { private static readonly MySingleton theOneAndOnly; static MySingleton() { theOneAndOnly = new MySingleton(); } public static MySingleton TheOnly { get { return theOneAndOnly; } } …
staticコンストラクタを使用する。 public class MySingleton { private static readonly MySingleton theOneAndOnly; static MySingleton() { theOneAndOnly = new MySingleton(); } public static MySingleton TheOnly { get { return theOneAndOnly; } } …