private CreateWatcher ( string path, FileSystemWatcherMode mode, string filter ) : BlueCollar.FileSystemWatcher | ||
path | string | The path to watch. |
mode | FileSystemWatcherMode | The watch mode. |
filter | string | The file search filter to use. |
Результат | BlueCollar.FileSystemWatcher |
private BlueCollar.FileSystemWatcher CreateWatcher(string path, FileSystemWatcherMode mode, string filter)
{
BlueCollar.FileSystemWatcher watcher = null;
try
{
watcher = new BlueCollar.FileSystemWatcher(path);
watcher.Operation += new FileSystemEventHandler(this.WatcherOperation);
watcher.Mode = mode;
watcher.Filter = filter;
watcher.Threshold = this.Threshold;
watcher.EnableRaisingEvents = true;
}
catch
{
if (watcher != null)
{
watcher.Dispose();
}
throw;
}
return watcher;
}