Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        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;
            }
        }