internal ConfigProviderXml(string fileName) { //_storage = IsolatedStorageFile.GetMachineStoreForAssembly(); _directory = Environment.GetEnvironmentVariable("BMCConfigPath", EnvironmentVariableTarget.Machine); FILE_NAME = "BMCApp.xml"; _fileName = Path.Combine(_directory, FILE_NAME); _fileWathcer = new FileModificationWatcher(_fileName); _fileWathcer.FileModified += OnFileWathcer_FileModified; _fileWathcer.StartMonitoring(); #if CFG_MUTEX _mutexName = "Mutex_" + _mutexName; this.InitMutex(); #endif }
void OnFileWathcer_FileModified(FileModificationWatcher watcher) { try { if (!_isSavedByMe) { this.Load(); } } catch (Exception ex) { EventLogExceptionAdapter.WriteException(ex); } finally { if (_isSavedByMe) { _isSavedByMe = false; } } }
void OnFileWathcer_FileModified(FileModificationWatcher watcher) { try { if (!_isSavedByMe) { this.Load(); } } catch (Exception ex) { EventLogExceptionAdapter.WriteException(ex); } finally { if (_isSavedByMe) _isSavedByMe = false; } }