public bool TryAcquireMonitor(string directoryPath, string filter, bool isContinued, Action <IFileMonitor> fileChangeCallback, WatcherChangeTypes changeTypes, ref IFileMonitor fileMonitor) { try { fileMonitor = new FileMonitor(directoryPath, filter, isContinued, fileChangeCallback, changeTypes); return(true); } catch { fileMonitor = null; return(false); } }
public bool TryAcquireMonitor(string directoryPath, string filter, bool isContinued, Action<IFileMonitor> fileChangeCallback, WatcherChangeTypes changeTypes, ref IFileMonitor fileMonitor) { try { fileMonitor= new FileMonitor(directoryPath, filter, isContinued, fileChangeCallback, changeTypes); return true; } catch { fileMonitor = null; return false; } }