Exemplo n.º 1
0
 protected bool Equals(EventWatchItem other)
 {
     return string.Equals(FullPath, other.FullPath);
 }
Exemplo n.º 2
0
        private void FileSystemWatcherOnCreated(object sender, FileSystemEventArgs e)
        {
            var eventWatchItem = new EventWatchItem { FullPath = e.FullPath, Created = DateTime.Now};
            if (_hashBlockingQueue.Any(x => x.Value.FullPath.StartsWith(eventWatchItem.FullPath)))
                return;

            if (_fileLockHelper.IsFileSystemLocked(e.FullPath))
                return;

            _hashBlockingQueue.TryAdd(e.FullPath, eventWatchItem);
            OnCreated?.Invoke(new FileSystemOnCreatedHandlerArgs { FullPath = e.FullPath });
        }