public virtual IEnumerable <BookCollection> GetSourceCollections()
{
foreach (var root in RepositoryFolders)
{
if (!Directory.Exists(root))
{
continue;
}
foreach (var dir in Directory.GetDirectories(root))
{
if (dir == _editableCollectionDirectory || Path.GetFileName(dir).StartsWith(".")) //skip thinks like .idea, .hg, etc.
{
continue;
}
yield return(_bookCollectionFactory(dir, BookCollection.CollectionType.SourceCollection));
}
//follow shortcuts
foreach (var shortcut in Directory.GetFiles(root, "*.lnk", SearchOption.TopDirectoryOnly))
{
var path = ResolveShortcut.Resolve(shortcut);
if (path != _editableCollectionDirectory && Directory.Exists(path))
{
yield return(_bookCollectionFactory(path, BookCollection.CollectionType.SourceCollection));
}
}
}
}