public override IEnumerable <IDestination> DynamicDestinations() { foreach (OneNotePage page in OneNoteExporter.GetPages()) { yield return(new OneNoteDestination(page)); } }
protected override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) { var exportInformation = new ExportInformation(Designation, Description); if (_page == null) { try { exportInformation.ExportMade = OneNoteExporter.ExportToNewPage(surface); } catch (Exception ex) { exportInformation.ErrorMessage = ex.Message; Log.Error().WriteLine(ex); } } else { try { exportInformation.ExportMade = OneNoteExporter.ExportToPage(surface, _page); } catch (Exception ex) { exportInformation.ErrorMessage = ex.Message; Log.Error().WriteLine(ex); } } return(exportInformation); }
public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) { base.SetDefaults(surface); ExportInformation exportInformation = new ExportInformation(Designation, Description); if (page == null) { try { exportInformation.ExportMade = OneNoteExporter.ExportToNewPage(surface); } catch (Exception ex) { exportInformation.ErrorMessage = ex.Message; LOG.Error(ex); } } else { try { exportInformation.ExportMade = OneNoteExporter.ExportToPage(surface, page); } catch (Exception ex) { exportInformation.ErrorMessage = ex.Message; LOG.Error(ex); } } return(exportInformation); }
public override bool ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) { using (Image image = surface.GetImageForExport()) { if (page != null) { try { OneNoteExporter.ExportToPage((Bitmap)image, page); } catch (Exception ex) { LOG.Error(ex); } } } return(true); }
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); } } return(exportInformation); }
public override IEnumerable <IDestination> DynamicDestinations() { try { return(OneNoteExporter.GetPages().Where(currentPage => currentPage.IsCurrentlyViewed).Select(currentPage => new OneNoteDestination(currentPage, CoreConfiguration, GreenshotLanguage))); } catch (COMException cEx) { if (cEx.ErrorCode == unchecked ((int)0x8002801D)) { Log.Warn().WriteLine("Wrong registry keys, to solve this remove the OneNote key as described here: http://microsoftmercenary.com/wp/outlook-excel-interop-calls-breaking-solved/"); } Log.Warn().WriteLine(cEx, "Problem retrieving onenote destinations, ignoring: "); } catch (Exception ex) { Log.Warn().WriteLine(ex, "Problem retrieving onenote destinations, ignoring: "); } return(Enumerable.Empty <IDestination>()); }