/// <summary>
///
/// </summary>
/// <returns>True if the collection should be shown</returns>
private bool LoadOneCollection(BookCollection collection, FlowLayoutPanel flowLayoutPanel)
{
collection.CollectionChanged += OnCollectionChanged;
bool loadedAtLeastOneBook = false;
foreach (var bookInfo in collection.GetBookInfos())
{
try
{
if (!bookInfo.IsExperimental || Settings.Default.ShowExperimentalBooks)
{
loadedAtLeastOneBook = true;
AddOneBook(bookInfo, flowLayoutPanel, collection);
}
}
catch (Exception error)
{
ErrorReport.NotifyUserOfProblem(error, "Could not load the book at " + bookInfo.FolderPath);
}
}
if (collection.ContainsDownloadedBooks)
{
_downloadedBookCollection = collection;
collection.FolderContentChanged += DownLoadedBooksChanged;
collection.WatchDirectory(); // In case another instance downloads a book.
var bloomLibrayLink = new LinkLabel()
{
Text =
LocalizationManager.GetString("CollectionTab.BloomLibraryLinkLabel",
"Get more source books at BloomLibrary.org",
"Shown at the bottom of the list of books. User can click on it and it will attempt to open a browser to show the Bloom Library"),
Width = 400,
Margin = new Padding(17, 0, 0, 0),
LinkColor = Palette.TextAgainstDarkBackground
};
bloomLibrayLink.Click += new EventHandler(OnBloomLibrary_Click);
flowLayoutPanel.Controls.Add(bloomLibrayLink);
return true;
}
return loadedAtLeastOneBook;
}