The code of the class is to much to post but here are the important parts
Singleton initialization:
private static readonly ApplicationSettings _instance = Singleton<ApplicationSettings>.Instance;
Singleton access:
public static ApplicationSettings Instance{
get {
return ApplicationSettings._instance;
}
}
Sample Setting property:
public string SmtpHostAddress {
get {
if (this._smtpHostAddress == null) {
this._smtpHostAddress = this.SafeString("SmtpHostAddress", "127.0.0.1");
}
return this._smtpHostAddress;
}
}
Also here is the code for the genric singleton class whcih Im sure you will want to see:
public static class Singleton<T> where T : class{
public static readonly T Instance = typeof(T).InvokeMember(typeof(T).Name,
BindingFlags.CreateInstance |
BindingFlags.Instance |
BindingFlags.NonPublic, null, null, null, CultureInfo.InvariantCulture) as T;
}
Please let me know how I can be of further help in resolving this. Thank you.