private static void EnsureConfigIsLoaded()
{
if (_config == null)
{
_config = new XmlDocument();
_config.Load(ConfigFilePath());
var watcher = new FileSystemWatcher(Path.GetDirectoryName(ConfigFilePath()), Path.GetFileName(ConfigFilePath()));
FileSystemEventHandler configChangedHandler = delegate
{
watcher = null;
_config = null;
};
watcher.Changed += configChangedHandler;
watcher.NotifyFilter = NotifyFilters.LastWrite;
watcher.EnableRaisingEvents = true;
}
}