私はジョンスキートのexampleC#でdbから値を取り込むシングルトンはどのように実装できますか?
public sealed class Singleton
{
Singleton()
{
}
public static Singleton Instance
{
get
{
return Nested.instance;
}
}
class Nested
{
// Explicit static constructor to tell C# compiler
// not to mark type as beforefieldinit
static Nested()
{
}
internal static readonly Singleton instance = new Singleton();
}
}
私は右の人の回答を得ました。 )...ありがとう...うん.. ..コンストラクタでLoadSettings()メソッド呼び出しを追加...追加しようとしていた: foreach(sett.GetProperties()内のPropertyInfo propertyInformation){ 反射歩行...バグがあった... –