private void WatchStragetyFile() { logger.InfoFormat("start watch directory#{0}, strategy-file#{1}", KK.ResourceDir(), StrategyFileName); if (watcher != null) { watcher.Dispose(); logger.InfoFormat("Dispose previous watcher#{0}", watcher); } watcher = new FileSystemWatcher(); watcher.Path = KK.ResourceDir(); watcher.Filter = StrategyFileName; watcher.Changed += new FileSystemEventHandler(OnProcess); watcher.EnableRaisingEvents = true; // | NotifyFilters.LastAccess | NotifyFilters.Size watcher.NotifyFilter = NotifyFilters.Attributes | NotifyFilters.CreationTime | NotifyFilters.DirectoryName | NotifyFilters.FileName | NotifyFilters.LastWrite | NotifyFilters.Security; watcher.IncludeSubdirectories = false; }