Пример #1
0
        private void HandleFileSystemEvent(FileSystemEventArgs a)
        {
            Initialize();

            var fileInfo = FileInfo.Create(GetRootPath(PathInfo.GetSubPath(_basePath, a.FullPath)));

            if (fileInfo != null)
            {
                NotifySubscriptions(fileInfo);
            }
        }
Пример #2
0
        private void Initialize()
        {
            _fileInfo = new HashSet <PathInfo>(
                Directory.EnumerateFiles(_basePathConverted, "*", SearchOption.AllDirectories)
                .Select(fileName => PathInfo.GetSubPath(_basePath, fileName)));

            _fileInfoCache = _fileInfo.ToDictionary(i => GetRootPath(i), i => FileInfo.Create(GetRootPath(i)));

            _directoryInfo = new HashSet <PathInfo>(
                Directory.EnumerateDirectories(_basePathConverted, "*", SearchOption.AllDirectories)
                .Select(fileName => PathInfo.GetSubPath(_basePath, fileName)));
        }