コード例 #1
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);
        }
コード例 #2
0
ファイル: OneNoteDestination.cs プロジェクト: cailh/greenshot
        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);
        }
コード例 #3
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);
 }
コード例 #4
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);
        }