Quellcode durchsuchen

compdfkit(win) - 修正打开新文档释放原文档的时机

weixiangjie vor 1 Jahr
Ursprung
Commit
caca4d1fdf

+ 1 - 4
Demo/Examples/Annotations/MainWindow.xaml.cs

@@ -261,10 +261,6 @@ namespace AnnotationViewControl
                     {
                         return;
                     }
-                    else
-                    {
-                        pdfViewer.PDFView.Document.Release();
-                    }
                 }
 
                 passwordViewer = new PDFViewControl();
@@ -284,6 +280,7 @@ namespace AnnotationViewControl
                 }
                 else
                 {
+                    pdfViewer.PDFView.Document.Release();
                     pdfViewer = passwordViewer;
                     LoadDocument();
                 }

+ 1 - 4
Demo/Examples/ContentEditor/MainWindow.xaml.cs

@@ -259,10 +259,6 @@ namespace ContentEditorViewControl
                     {
                         return;
                     }
-                    else
-                    {
-                        pdfViewer.PDFView.Document.Release();
-                    }
                 }
 
                 passwordViewer = new PDFViewControl();
@@ -282,6 +278,7 @@ namespace ContentEditorViewControl
                 }
                 else
                 {
+                    pdfViewer.PDFView.Document.Release();
                     pdfViewer = passwordViewer;
                     LoadDocument();
                 }

+ 1 - 4
Demo/Examples/DigitalSignature/MainWindow.xaml.cs

@@ -147,10 +147,6 @@ namespace DigitalSignature
                     {
                         return;
                     }
-                    else
-                    {
-                        pdfViewer.PDFView.Document.Release();
-                    }
                 }
 
                 passwordViewer = new PDFViewControl();
@@ -170,6 +166,7 @@ namespace DigitalSignature
                 }
                 else
                 {
+                    pdfViewer.PDFView.Document.Release();
                     pdfViewer = passwordViewer;
                     LoadDocument();
                 }

+ 1 - 4
Demo/Examples/Forms/MainWindow.xaml.cs

@@ -248,10 +248,6 @@ namespace FormViewControl
                     {
                         return;
                     }
-                    else
-                    {
-                        pdfViewer.PDFView.Document.Release();
-                    }
                 }
 
                 passwordViewer = new PDFViewControl();
@@ -271,6 +267,7 @@ namespace FormViewControl
                 }
                 else
                 {
+                    pdfViewer.PDFView.Document.Release();
                     pdfViewer = passwordViewer;
                     LoadDocument();
                 }

+ 1 - 4
Demo/Examples/PDFViewer/MainPage.xaml.cs

@@ -439,10 +439,6 @@ namespace PDFViewer
                     {
                         return;
                     }
-                    else
-                    {
-                        pdfViewer.PDFView.Document.Release();
-                    }
                 }
 
                 if ((bool)CheckExistBeforeOpenFileEvent?.Invoke(new string[] { filePath, oldFilePath }))
@@ -467,6 +463,7 @@ namespace PDFViewer
                 }
                 else
                 {
+                    pdfViewer.PDFView.Document.Release();
                     pdfViewer = passwordViewer;
                     LoadDocument();
                     FileChangeEvent?.Invoke(null, EventArgs.Empty);

+ 1 - 4
Demo/Examples/Viewer/MainWindow.xaml.cs

@@ -343,10 +343,6 @@ namespace Viewer
                     {
                         return;
                     }
-                    else
-                    {
-                        pdfViewControl.PDFView.Document.Release();
-                    }
                 }
 
                 passwordViewer = new PDFViewControl();
@@ -366,6 +362,7 @@ namespace Viewer
                 }
                 else
                 {
+                    pdfViewControl.PDFView.Document.Release();
                     pdfViewControl = passwordViewer;
                     LoadDocument();
                 }