public FolderListener(FolderListenerConfigurationSection folderListenerConfigurations, IFileSystem fileSystem = null, FileNameManager fileNameManager = null) { _folderListenerConfigurations = folderListenerConfigurations ?? throw new ArgumentNullException(messages.ConfigurationArgumentNullException); var foldersPathes = _folderListenerConfigurations.GetFolders().Select(x => x.Path); _fileSystemWatchers = CreateMultipleFileSystemWatcher(foldersPathes); _fileSystem = fileSystem ?? new FileSystem(); _fileNameManager = fileNameManager ?? new FileNameManager(_fileSystem); }
public static IEnumerable <FolderElement> GetFolders(this FolderListenerConfigurationSection configurations) { var folders = configurations.Folders; if (folders != null) { foreach (FolderElement folder in folders) { yield return(folder); } } }
public static IEnumerable <FileIgnoreTemplate> GetIgnoreTemplates(this FolderListenerConfigurationSection configurations) { var ignoreTemplates = configurations.IgnoreTemplates; if (ignoreTemplates != null) { foreach (FileIgnoreTemplate ignoreTemplate in ignoreTemplates) { yield return(ignoreTemplate); } } }
public static IEnumerable <RuleElement> GetRules(this FolderListenerConfigurationSection configurations) { var rules = configurations.Rules; if (rules != null) { foreach (RuleElement rule in rules) { yield return(rule); } } }