private void InitFileSystemWatcher() { if (!TredH.GetFlag(ref watcherFlag)) { try { FSH.WatchFile(this.xmlFile, (e) => { if (e.FullPath.ToUpper() == this.xmlFileUpper) { Interlocked.Increment(ref changeCount); ThreadHelper.InvokeOnce(RaiseConifgChanged, SMath.Second); } else { if (e.ChangeType == WatcherChangeTypes.Renamed) { if (((RenamedEventArgs)e).OldFullPath.ToUpper() == this.xmlFileUpper) { Interlocked.Increment(ref changeCount); TredH.InvokeOnce(RaiseConifgChanged, SMath.Second); } } } }); } catch (Exception ex) { } } }
private void InitFileSystemWatcher() { if (TredH.GetFlag(ref watchflag)) { FSH.WatchFile(this.jsonfile, (e) => { if (e.FullPath.ToUpper() == this.jsonfileUpper) { Interlocked.Increment(ref changecount); } else { if (e.ChangeType == WatcherChangeTypes.Renamed) { if (((RenamedEventArgs)e).OldFullPath.ToUpper() == this.jsonfileUpper) { Interlocked.Increment(ref changecount); } } } }); } }