public IEnumerable <ToolStripItem> GetExtensionMenuItems()
{
//for now we're not doing real extension dlls, just kind of faking it. So we will limit this load
//to books we know go with this currently "built-in" "extension" for SIL LEAD's SHRP Project.
if (SHRP_PupilBookExtension.ExtensionIsApplicable(BookSelection.CurrentSelection))
{
//load any extension assembly found in the template's root directory
//var catalog = new DirectoryCatalog(this.BookSelection.CurrentSelection.FindTemplateBook().FolderPath, "*.dll");
var catalog = new AssemblyCatalog(Assembly.GetExecutingAssembly());
var container = new CompositionContainer(catalog);
//inject what we have to offer for the extension to consume
container.ComposeExportedValue <string>("PathToBookFolder", BookSelection.CurrentSelection.FolderPath);
container.ComposeExportedValue <string>("Language1Iso639Code", _currentlyLoadedBook.BookData.Language1.Iso639Code);
container.ComposeExportedValue <Func <IEnumerable <HtmlDom> > >(GetPageDoms);
// container.ComposeExportedValue<Func<string>>("pathToPublishedHtmlFile",GetFileForPrinting);
//get the original images, not compressed ones (just in case the thumbnails are, like, full-size & they want quality)
container.ComposeExportedValue <Action <int, int, HtmlDom, Action <Image>, Action <Exception> > >(GetThumbnailAsync);
container.SatisfyImportsOnce(this);
return(_getExtensionMenuItems == null ? new List <ToolStripItem>() : _getExtensionMenuItems());
}
else
{
return(new List <ToolStripMenuItem>());
}
}