我有一个单例类,它正在读取配置文件。
public sealed class SettingsHelper
{
private static readonly SettingsHelper _Instance = new SettingsHelper();
static SettingsHelper()
{
}
public static SettingsHelper Instance
{
get
{
return _Instance;
}
}
private NameValueCollection _SettingsSection = null;
public SettingsHelper()
{
_SettingsSection = new NameValueCollection(ConfigurationManager.AppSettings);
}
.....
}
}
但是,如果配置文件被更改,单身人士不会接受更改。有没有办法重新创建单例实例(调用它的构造函数)或者我应该创建单独的方法来重新启动单例实例?