Enhancements to the OneNote exporter, this will now show a list of all pages and use the current viewed by default. After export we try to navigate to the page we exported to.

This commit is contained in:
RKrom 2014-07-29 13:10:02 +02:00
commit 87f4d83fd2
3 changed files with 37 additions and 15 deletions

View file

@ -109,14 +109,21 @@ namespace GreenshotOfficePlugin {
public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) {
ExportInformation exportInformation = new ExportInformation(this.Designation, this.Description);
if (page != null) {
try {
OneNoteExporter.ExportToPage(surface, page);
exportInformation.ExportMade = true;
} catch (Exception ex) {
exportInformation.ErrorMessage = ex.Message;
LOG.Error(ex);
// No page selected, take the current
List<OneNotePage> pages = OneNoteExporter.GetPages();
if(pages == null || pages.Count == 0) {
return exportInformation;
}
page = pages[0];
}
try {
OneNoteExporter.ExportToPage(surface, page);
exportInformation.ExportMade = true;
} catch (Exception ex) {
exportInformation.ErrorMessage = ex.Message;
LOG.Error(ex);
}
return exportInformation;
}