private void UnregisterIconWatcherImpl(string name, bool deleteResource) { IResourceList watchList = (IResourceList)WatchedLists[name]; watchList.ResourceAdded -= watchList_ResourceAdded; watchList.ResourceDeleting -= watchList_ResourceDeleting; watchList.Deinstantiate(); if (deleteResource) { IResource rule = FindRule(name); Core.FilterRegistry.DeleteView(rule); } WatchedLists.Remove(name); WatchedIcons.Remove(name); WatchersOrder.Remove(name); ModifyIcon(); }