コード例 #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);
        }