示例#1
0
 public override IEnumerable <IDestination> DynamicDestinations()
 {
     foreach (OneNotePage page in OneNoteExporter.GetPages())
     {
         yield return(new OneNoteDestination(page));
     }
 }
示例#2
0
        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);
        }
示例#3
0
        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);
        }
示例#4
0
 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);
 }
示例#5
0
        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);
        }
示例#6
0
 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>());
 }