mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 02:37:03 -07:00
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:
parent
2b747650ae
commit
87f4d83fd2
3 changed files with 37 additions and 15 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue