public void UnwatchFile(string path)
{
var dir = Path.GetDirectoryName(path);
DirectoryWatcher w;
if (dwatchers.TryGetValue(dir, out w))
{
var file = Path.GetFileName(path);
w.UnWatch(file);
if (w.Files.Count == 0)
{
dwatchers.Remove(dir);
w.Dispose();
}
}
}