/// <summary> /// 删除监视 WEB 视图服务 /// </summary> /// <param name="server"></param> internal static void Remove(ViewServer server) { HashString path = server.WorkPath; VersionFileWatcher watcher, removeWatcher = null; Monitor.Enter(watcherLock); try { if (watchers.TryGetValue(path, out watcher) && watcher.remove(server)) { watchers.Remove(path); removeWatcher = watcher; } } finally { Monitor.Exit(watcherLock); } if (removeWatcher != null) { removeWatcher.Dispose(); } }