protected virtual void Dispose(bool disposing)
        {
            Logging.Debug("LibraryIndexHoverPopup::Dispose({0}) @{1}", disposing, dispose_count);

            WPFDoEvents.InvokeInUIThread(() =>
            {
                WPFDoEvents.SafeExec(() =>
                {
                    ImageThumbnail.Visibility = Visibility.Collapsed;
                    ImageThumbnail.Source     = null;
                });

                WPFDoEvents.SafeExec(() =>
                {
                    pdf_document            = null;
                    specific_pdf_annotation = null;
                });

                WPFDoEvents.SafeExec(() =>
                {
                    DataContext = null;
                });

                ++dispose_count;
            });
        }
        protected virtual void Dispose(bool disposing)
        {
            Logging.Debug("CSLProcessorOutputConsumer::Dispose({0}) @{1}", disposing, dispose_count);

            WPFDoEvents.InvokeInUIThread(() =>
            {
                WPFDoEvents.SafeExec(() =>
                {
                    if (dispose_count == 0)
                    {
                        // Get rid of managed resources
                        web_browser?.Dispose();
                    }
                });

                WPFDoEvents.SafeExec(() =>
                {
                    web_browser = null;

                    brd           = null;
                    user_argument = null;
                });

                WPFDoEvents.SafeExec(() =>
                {
                    position_to_inline.Clear();
                    inline_to_positions.Clear();
                    position_to_text.Clear();
                    bibliography.Clear();
                    logs.Clear();
                });

                ++dispose_count;
            });
        }
        protected virtual void Dispose(bool disposing)
        {
            Logging.Debug("MainWindow::Dispose({0}) @{1}", disposing, dispose_count);

            WPFDoEvents.SafeExec(() =>
            {
                if (dispose_count == 0)
                {
                    ipc_server?.Stop();
                }
            }, must_exec_in_UI_thread: true);

            WPFDoEvents.SafeExec(() =>
            {
                ObjStartPage = null;

                keyboard_hook = null;
                ipc_server    = null;
            });

            WPFDoEvents.SafeExec(() =>
            {
                DataContext = null;
            });

            ++dispose_count;
        }
        protected virtual void Dispose(bool disposing)
        {
            Logging.Debug("SpeedReadControl::Dispose({0}) @{1}", disposing, dispose_count);

            WPFDoEvents.SafeExec(() =>
            {
                // Get rid of managed resources and background threads
                playing = false;

                if (thread != null)
                {
                    thread.Join();
                }
            });

            WPFDoEvents.SafeExec(() =>
            {
                words.Clear();
            });

            WPFDoEvents.SafeExec(() =>
            {
                DataContext = null;
            });

            ++dispose_count;
        }
        protected virtual void Dispose(bool disposing)
        {
            Logging.Debug("PDFReadingControl::Dispose({0}) @{1}", disposing, dispose_count);

            WPFDoEvents.SafeExec(() =>
            {
                if (dispose_count == 0)
                {
                    // Get rid of managed resources
                    PDFRendererControlArea.Children.Clear();

                    pdf_renderer_control?.Dispose();

                    pdf_renderer_control_stats?.pdf_document.PDFRenderer.FlushCachedPageRenderings();
                }
            }, must_exec_in_UI_thread: true);

            WPFDoEvents.SafeExec(() =>
            {
                pdf_renderer_control       = null;
                pdf_renderer_control_stats = null;
            });

            ++dispose_count;
        }
Beispiel #6
0
        protected virtual void Dispose(bool disposing)
        {
            Logging.Debug("WebsiteNodeContentControl::Dispose({0}) @{1}", disposing, dispose_count);

            WPFDoEvents.InvokeInUIThread(() =>
            {
                WPFDoEvents.SafeExec(() =>
                {
                    if (dispose_count == 0)
                    {
                        // Get rid of managed resources / get rid of cyclic references:
                        fader?.Dispose();
                    }
                    fader = null;
                });

                WPFDoEvents.SafeExec(() =>
                {
                    website_node_content = null;
                    DataContext          = null;
                });

                ++dispose_count;
            });
        }
        protected virtual void Dispose(bool disposing)
        {
            Logging.Debug("PDFInkLayer::Dispose({0}) @{1}", disposing, dispose_count);

            WPFDoEvents.InvokeInUIThread(() =>
            {
                WPFDoEvents.SafeExec(() =>
                {
                    if (0 == dispose_count)
                    {
                        if (null != ObjInkCanvas)
                        {
                            ObjInkCanvas.StrokeCollected  -= ObjInkCanvas_StrokeCollected;
                            ObjInkCanvas.StrokeErased     -= ObjInkCanvas_StrokeErased;
                            ObjInkCanvas.SelectionMoved   -= ObjInkCanvas_SelectionMoved;
                            ObjInkCanvas.SelectionResized -= ObjInkCanvas_SelectionResized;

                            ObjInkCanvas.RequestBringIntoView -= ObjInkCanvas_RequestBringIntoView;
                        }
                    }
                });

                WPFDoEvents.SafeExec(() =>
                {
                    if (dispose_count == 0)
                    {
                        foreach (var el in Children)
                        {
                            IDisposable node = el as IDisposable;
                            if (null != node)
                            {
                                node.Dispose();
                            }
                        }
                    }
                });

                WPFDoEvents.SafeExec(() =>
                {
                    Children.Clear();
                });

                WPFDoEvents.SafeExec(() =>
                {
                    // Clear the references for sanity's sake
                    pdf_document = null;

                    Dispatcher.ShutdownStarted -= Dispatcher_ShutdownStarted;
                });

                WPFDoEvents.SafeExec(() =>
                {
                    DataContext = null;
                });

                ++dispose_count;

                //base.Dispose(disposing);     // parent only throws an exception (intentionally), so depart from best practices and don't call base.Dispose(bool)
            });
        }
Beispiel #8
0
        protected virtual void Dispose(bool disposing)
        {
            Logging.Debug("ReadOutLoudManager::Dispose({0}) @{1}", disposing, dispose_count);

            WPFDoEvents.InvokeInUIThread(() =>
            {
                WPFDoEvents.SafeExec(() =>
                {
                    if (dispose_count == 0)
                    {
                        // Get rid of managed resources
                        speech_synthesizer?.Dispose();
                    }
                    speech_synthesizer = null;
                });

                WPFDoEvents.SafeExec(() =>
                {
                    current_prompt = null;
                    last_words?.Clear();
                    last_words = null;
                });

                ++dispose_count;
            });
        }
        protected virtual void Dispose(bool disposing)
        {
            Logging.Debug("StringNodeContentControl::Dispose({0}) @{1}", disposing, dispose_count);

            WPFDoEvents.SafeExec(() =>
            {
                if (dispose_count == 0)
                {
                    // Get rid of managed resources / get rid of cyclic references:
                    fader?.Dispose();
                }
                fader = null;
            });

            WPFDoEvents.SafeExec(() =>
            {
                MouseDoubleClick -= StringNodeContentControl_MouseDoubleClick;
                KeyDown          -= StringNodeContentControl_KeyDown;

                TxtEdit.LostFocus      -= edit_text_box_LostFocus;
                TxtEdit.PreviewKeyDown -= edit_text_box_PreviewKeyDown;
            });

            WPFDoEvents.SafeExec(() =>
            {
                DataContext = null;
            });

            ++dispose_count;
        }
Beispiel #10
0
        protected virtual void Dispose(bool disposing)
        {
            Logging.Debug("ProcessOutputReader::Dispose({0}) @{1}", disposing, dispose_count);

            WPFDoEvents.SafeExec(() =>
            {
                if (dispose_count == 0)
                {
                    // Get rid of managed resources
                    process.CancelErrorRead();
                    if (!StdOutIsBinary)
                    {
                        process.CancelOutputRead();
                    }

                    lock (io_buffers_lock)
                    {
                        Output.Clear();
                        Error.Clear();
                    }
                }
            });

            WPFDoEvents.SafeExec(() =>
            {
                process = null;
            });

            ++dispose_count;
        }
Beispiel #11
0
        protected virtual void Dispose(bool disposing)
        {
            Logging.Debug("PDFAnnotationNodeContentControl::Dispose({0}) @{1}", disposing, dispose_count);

            WPFDoEvents.InvokeInUIThread(() =>
            {
                WPFDoEvents.SafeExec(() =>
                {
                    if (dispose_count == 0)
                    {
                        library_index_hover_popup?.Dispose();

                        ToolTipClosing -= PDFDocumentNodeContentControl_ToolTipClosing;
                        ToolTipOpening -= PDFDocumentNodeContentControl_ToolTipOpening;
                    }
                });

                WPFDoEvents.SafeExec(() =>
                {
                    // Clear the references for sanity's sake
                    pdf_annotation_node_content = null;
                    library_index_hover_popup   = null;
                });

                ++dispose_count;
            });
        }
Beispiel #12
0
        protected virtual void Dispose(bool disposing)
        {
            Logging.Debug("LuceneIndex::Dispose({0}) @{1}", disposing, dispose_count);

            WPFDoEvents.SafeExec(() =>
            {
                if (dispose_count == 0)
                {
                    // Get rid of managed resources
                    Logging.Info("Disposing the lucene index writer");

                    // Utilities.LockPerfTimer l1_clk = Utilities.LockPerfChecker.Start();
                    lock (index_writer_lock)
                    {
                        // l1_clk.LockPerfTimerStop();
                        FlushIndexWriter_LOCK();
                    }
                }
            });

            WPFDoEvents.SafeExec(() =>
            {
                // Utilities.LockPerfTimer l2_clk = Utilities.LockPerfChecker.Start();
                lock (index_writer_lock)
                {
                    // l2_clk.LockPerfTimerStop();
                    index_writer = null;
                }
            });

            ++dispose_count;
        }
        protected virtual void Dispose(bool disposing)
        {
            Logging.Debug("PDFDocumentNodeContentControl::Dispose({0}) @{1}", disposing, dispose_count);

            WPFDoEvents.SafeExec(() =>
            {
                if (dispose_count == 0)
                {
                    library_index_hover_popup?.Dispose();
                }
                library_index_hover_popup = null;
            });

            WPFDoEvents.SafeExec(() =>
            {
                ToolTip = "";
            });

            WPFDoEvents.SafeExec(() =>
            {
                node_control = null;
                pdf_document_node_content = null;
            });

            WPFDoEvents.SafeExec(() =>
            {
                DataContextChanged -= PDFDocumentNodeContentControl_DataContextChanged;
                DataContext         = null;
            });

            ++dispose_count;
        }
Beispiel #14
0
        protected virtual void Dispose(bool disposing)
        {
            Logging.Debug("LibraryCatalogOverviewControl::Dispose({0}) @{1}", disposing, dispose_count);

            WPFDoEvents.InvokeInUIThread(() =>
            {
                WPFDoEvents.SafeExec(() =>
                {
                    if (dispose_count == 0)
                    {
                        // Get rid of managed resources / get rid of cyclic references:
                        library_index_hover_popup?.Dispose();
                    }
                });

                WPFDoEvents.SafeExec(() =>
                {
                    WPFDoEvents.AssertThisCodeIsRunningInTheUIThread();
                    if (dispose_count == 0)
                    {
                        WizardDPs.ClearPointOfInterest(PanelSearchScore);
                    }
                });

                WPFDoEvents.SafeExec(() =>
                {
                    if (dispose_count == 0)
                    {
                        WizardDPs.ClearPointOfInterest(ObjLookInsidePanel);
                    }
                });

                WPFDoEvents.SafeExec(() =>
                {
                    TextTitle.MouseLeftButtonUp -= TextTitle_MouseLeftButtonUp;

                    ButtonOpen.ToolTipOpening -= HyperlinkPreview_ToolTipOpening;
                    ButtonOpen.ToolTipClosing -= HyperlinkPreview_ToolTipClosing;

                    ListSearchDetails.SearchClicked -= ListSearchDetails_SearchSelectionChanged;

                    DataContextChanged -= LibraryCatalogOverviewControl_DataContextChanged;
                });

                WPFDoEvents.SafeExec(() =>
                {
                    DataContext = null;
                });

                WPFDoEvents.SafeExec(() =>
                {
                    // Clear the references for sanity's sake
                    library_index_hover_popup = null;
                    drag_drop_helper          = null;
                });

                ++dispose_count;
            });
        }
Beispiel #15
0
        protected virtual void Dispose(bool disposing)
        {
            Logging.Debug("WebBrowserControl::Dispose({0}) @{1}", disposing, dispose_count);

            WPFDoEvents.SafeExec(() =>
            {
                // Prevent recursive run-away of the code via the chain:
                //
                // ***  Qiqqa.exe!Qiqqa.WebBrowsing.WebBrowserControl.Dispose(bool disposing)
                // **   Qiqqa.exe!Qiqqa.WebBrowsing.WebBrowserControl.Dispose()
                //      Utilities.dll!Utilities.GUI.DualTabbedLayoutStuff.DualTabbedLayout.WantsClose(Utilities.GUI.DualTabbedLayoutStuff.DualTabbedLayoutItem item)
                //      Utilities.dll!Utilities.GUI.DualTabbedLayoutStuff.DualTabbedLayout.CloseContent(System.Windows.FrameworkElement fe)
                //      Qiqqa.exe!Qiqqa.WebBrowsing.WebBrowserHostControl.DeleteSearchers()
                //      Qiqqa.exe!Qiqqa.WebBrowsing.WebBrowserHostControl.Dispose(bool disposing)
                //      Qiqqa.exe!Qiqqa.WebBrowsing.WebBrowserHostControl.Dispose()
                // ***  Qiqqa.exe!Qiqqa.WebBrowsing.WebBrowserControl.Dispose(bool disposing)
                // **   Qiqqa.exe!Qiqqa.WebBrowsing.WebBrowserControl.Dispose()
                //
                // and prevent partial/broken cleanup due to chains like this one, resulting in
                // a dispose_count == 2:
                //
                // =2 * Qiqqa.exe!Qiqqa.WebBrowsing.WebBrowserHostControl.Dispose(bool disposing)
                //      Qiqqa.exe!Qiqqa.WebBrowsing.WebBrowserHostControl.Dispose()
                // =2 * Qiqqa.exe!Qiqqa.WebBrowsing.WebBrowserControl.Dispose(bool disposing)
                //      Qiqqa.exe!Qiqqa.WebBrowsing.WebBrowserControl.Dispose()
                // =1   Qiqqa.exe!Qiqqa.WebBrowsing.WebBrowserHostControl.Dispose(bool disposing)
                //      Qiqqa.exe!Qiqqa.WebBrowsing.WebBrowserHostControl.Dispose()
                // =1   Qiqqa.exe!Qiqqa.WebBrowsing.WebBrowserControl.Dispose(bool disposing)
                //      Qiqqa.exe!Qiqqa.WebBrowsing.WebBrowserControl.Dispose()
                //      Utilities.dll!Utilities.GUI.DualTabbedLayoutStuff.DualTabbedLayout.WantsClose(Utilities.GUI.DualTabbedLayoutStuff.DualTabbedLayoutItem item)
                //      Utilities.dll!Utilities.GUI.DualTabbedLayoutStuff.DualTabbedLayout.CloseContent(System.Windows.FrameworkElement fe)
                // *    Qiqqa.exe!Qiqqa.WebBrowsing.WebBrowserHostControl.DeleteSearchers()
                //      Qiqqa.exe!Qiqqa.WebBrowsing.WebBrowserHostControl.RebuildSearchers(System.Collections.Generic.HashSet<string> once_off_requested_web_searchers)
                //      Qiqqa.exe!Qiqqa.WebBrowsing.WebBrowserHostControl.ForceSnifferSearchers()
                //
                if (dispose_count == 0)
                {
                    // Get rid of managed resources
                    ObjWebBrowser?.Dispose();
                    ObjWebBrowser = null;

                    // Multiple WebBrowserControl instances MAY SHARE a single WebBrowserHostControl.
                    // It is passed to this class/instance as a reference anyway, so we SHOULD NOT
                    // kill/dispose it in here!
                    //
                    //web_browser_host_control.Dispose();
                    web_browser_host_control = null;
                }
            });

            WPFDoEvents.SafeExec(() =>
            {
                ObjWebBrowser            = null;
                web_browser_host_control = null;
            });

            ++dispose_count;
        }
        protected virtual void Dispose(bool disposing)
        {
            Logging.Debug("PDFRendererControl::Dispose({0}) @{1}", disposing, dispose_count);

            WPFDoEvents.InvokeInUIThread(() =>
            {
                WPFDoEvents.SafeExec(() =>
                {
                    if (dispose_count == 0)
                    {
                        if (!ShutdownableManager.Instance.IsShuttingDown)
                        {
                            pdf_renderer_control_stats?.pdf_document.QueueToStorage();
                        }
                    }
                });

                WPFDoEvents.SafeExec(() =>
                {
                    if (dispose_count == 0)
                    {
                        // Get rid of managed resources
                        List <PDFRendererPageControl> children = new List <PDFRendererPageControl>();
                        foreach (PDFRendererPageControl child in ObjPagesPanel.Children.OfType <PDFRendererPageControl>())
                        {
                            children.Add(child);
                        }

                        ObjPagesPanel.Children.Clear();

                        foreach (PDFRendererPageControl child in children)
                        {
                            WPFDoEvents.SafeExec(() =>
                            {
                                child.Dispose();
                            });
                        }
                    }
                });

                WPFDoEvents.SafeExec(() =>
                {
                    if (dispose_count == 0)
                    {
                        pdf_renderer_control_stats?.pdf_document.FlushCachedPageRenderings();
                    }

                    Dispatcher.ShutdownStarted -= Dispatcher_ShutdownStarted;
                });

                WPFDoEvents.SafeExec(() =>
                {
                    pdf_renderer_control_stats = null;
                });

                ++dispose_count;
            });
        }
        protected virtual void Dispose(bool disposing)
        {
            Logging.Debug("PDFTextSentenceLayer::Dispose({0}) @{1}", disposing, dispose_count);

            WPFDoEvents.InvokeInUIThread(() =>
            {
                WPFDoEvents.SafeExec(() =>
                {
                    if (dispose_count == 0)
                    {
                        foreach (var el in Children)
                        {
                            IDisposable node = el as IDisposable;
                            if (null != node)
                            {
                                node.Dispose();
                            }
                        }
                    }
                });

                WPFDoEvents.SafeExec(() =>
                {
                    ClearChildren();
                    Children.Clear();
                });

                WPFDoEvents.SafeExec(() =>
                {
                    if (drag_area_tracker != null)
                    {
                        drag_area_tracker.OnDragStarted    -= drag_area_tracker_OnDragStarted;
                        drag_area_tracker.OnDragInProgress -= drag_area_tracker_OnDragInProgress;
                        drag_area_tracker.OnDragComplete   -= drag_area_tracker_OnDragComplete;
                    }

                    Dispatcher.ShutdownStarted -= Dispatcher_ShutdownStarted;
                });

                WPFDoEvents.SafeExec(() =>
                {
                    // Clear the references for sanity's sake
                    pdf_renderer_control   = null;
                    drag_area_tracker      = null;
                    text_selection_manager = null;
                });

                WPFDoEvents.SafeExec(() =>
                {
                    DataContext = null;
                });

                ++dispose_count;

                //base.Dispose(disposing);     // parent only throws an exception (intentionally), so depart from best practices and don't call base.Dispose(bool)
            });
        }
        protected virtual void Dispose(bool disposing)
        {
            Logging.Debug("PDFAnnotationLayer::Dispose({0}) @{1}", disposing, dispose_count);

            WPFDoEvents.InvokeInUIThread(() =>
            {
                WPFDoEvents.SafeExec(() =>
                {
                    foreach (var el in Children)
                    {
                        IDisposable node = el as IDisposable;
                        if (null != node)
                        {
                            node.Dispose();
                        }
                    }
                });

                WPFDoEvents.SafeExec(() =>
                {
                    Children.Clear();
                });

                WPFDoEvents.SafeExec(() =>
                {
                    WizardDPs.ClearPointOfInterest(this);
                });

                WPFDoEvents.SafeExec(() =>
                {
                    if (drag_area_tracker != null)
                    {
                        drag_area_tracker.OnDragComplete -= drag_area_tracker_OnDragComplete;
                    }

                    Dispatcher.ShutdownStarted -= Dispatcher_ShutdownStarted;
                });

                WPFDoEvents.SafeExec(() =>
                {
                    // Clear the references for sanity's sake
                    pdf_document      = null;
                    drag_area_tracker = null;
                });

                WPFDoEvents.SafeExec(() =>
                {
                    DataContext = null;
                });

                ++dispose_count;

                //base.Dispose(disposing);     // parent only throws an exception (intentionally), so depart from best practices and don't call base.Dispose(bool)
            });
        }
        protected virtual void Dispose(bool disposing)
        {
            Logging.Debug("StartPageControl::Dispose({0}) @{1}", disposing, dispose_count);

            WPFDoEvents.SafeExec(() =>
            {
                DataContext = null;
            });

            ++dispose_count;
        }
Beispiel #20
0
        protected virtual void Dispose(bool disposing)
        {
            Logging.Debug("PDFHandLayer::Dispose({0}) @{1}", disposing, dispose_count);

            WPFDoEvents.InvokeInUIThread(() =>
            {
                WPFDoEvents.SafeExec(() =>
                {
                    if (0 == dispose_count)
                    {
                        WPFDoEvents.AssertThisCodeIsRunningInTheUIThread();

                        foreach (var el in Children)
                        {
                            IDisposable node = el as IDisposable;
                            if (null != node)
                            {
                                node.Dispose();
                            }
                        }
                    }
                });

                WPFDoEvents.SafeExec(() =>
                {
                    Children.Clear();
                });

                WPFDoEvents.SafeExec(() =>
                {
                    MouseDown -= PDFHandLayer_MouseDown;
                    MouseUp   -= PDFHandLayer_MouseUp;
                    MouseMove -= PDFHandLayer_MouseMove;

                    Dispatcher.ShutdownStarted -= Dispatcher_ShutdownStarted;
                });

                WPFDoEvents.SafeExec(() =>
                {
                    DataContext = null;
                });

                WPFDoEvents.SafeExec(() =>
                {
                    // Clear the references for sanity's sake
                    pdf_renderer_control = null;
                });

                ++dispose_count;

                //base.Dispose(disposing);     // parent only throws an exception (intentionally), so depart from best practices and don't call base.Dispose(bool)
            });
        }
        protected virtual void Dispose(bool disposing)
        {
            Logging.Debug("PDFAnnotationItem::Dispose({0}) @{1}", disposing, dispose_count);

            WPFDoEvents.InvokeInUIThread(() =>
            {
                WPFDoEvents.SafeExec(() =>
                {
                    if (dispose_count == 0)
                    {
                        // Get rid of managed resources / get rid of cyclic references:
                        if (null != pdf_annotation)
                        {
                            pdf_annotation.Bindable.PropertyChanged -= pdf_annotation_PropertyChanged;
                        }

                        ButtonAnnotationDetails.MouseEnter  -= ButtonAnnotationDetails_MouseEnter;
                        ButtonAnnotationDetails.MouseLeave  -= ButtonAnnotationDetails_MouseLeave;
                        ButtonAnnotationDetails.MouseDown   -= ButtonAnnotationDetails_MouseDown;
                        TextAnnotationText.GotFocus         -= TextAnnotationText_GotFocus;
                        TextAnnotationText.LostFocus        -= TextAnnotationText_LostFocus;
                        TextAnnotationText.PreviewMouseDown -= TextAnnotationText_PreviewMouseDown;
                        TextAnnotationText.PreviewMouseMove -= TextAnnotationText_PreviewMouseMove;
                        TextAnnotationText.PreviewMouseUp   -= TextAnnotationText_PreviewMouseUp;

                        ObjTagEditorControl.GotFocus  -= ObjTagEditorControl_GotFocus;
                        ObjTagEditorControl.LostFocus -= ObjTagEditorControl_LostFocus;

                        ObjTagEditorControl.TagFeature_Add    = null;
                        ObjTagEditorControl.TagFeature_Remove = null;

                        Dispatcher.ShutdownStarted -= Dispatcher_ShutdownStarted;
                    }
                });

                WPFDoEvents.SafeExec(() =>
                {
                    // Clear the references for sanity's sake
                    DataContext = null;
                });

                WPFDoEvents.SafeExec(() =>
                {
                    pdf_annotation_layer = null;
                    pdf_annotation       = null;

                    pdf_annotation_editor_control_popup = null;
                });

                ++dispose_count;
            });
        }
            protected virtual void Dispose(bool disposing)
            {
                Logging.Debug("DownloadAsyncTracker::Dispose({0}) @{1}", disposing, dispose_count);

                WPFDoEvents.SafeExec(() =>
                {
                    if (dispose_count == 0)
                    {
                        // Get rid of managed resources
                        CleanupAfterDownload();
                    }
                });

                ++dispose_count;
            }
Beispiel #23
0
        protected virtual void Dispose(bool disposing)
        {
            Logging.Debug("PDFHighlightLayer::Dispose({0}) @{1}", disposing, dispose_count);

            WPFDoEvents.SafeExec(() =>
            {
                foreach (var el in Children)
                {
                    IDisposable node = el as IDisposable;
                    if (null != node)
                    {
                        node.Dispose();
                    }
                }
            }, must_exec_in_UI_thread: true);

            WPFDoEvents.SafeExec(() =>
            {
                Children.Clear();
            }, must_exec_in_UI_thread: true);

            WPFDoEvents.SafeExec(() =>
            {
                if (drag_area_tracker != null)
                {
                    drag_area_tracker.OnDragStarted    -= drag_area_tracker_OnDragStarted;
                    drag_area_tracker.OnDragInProgress -= drag_area_tracker_OnDragInProgress;
                    drag_area_tracker.OnDragComplete   -= drag_area_tracker_OnDragComplete;
                }
            }, must_exec_in_UI_thread: true);

            WPFDoEvents.SafeExec(() =>
            {
                // Clear the references for sanity's sake
                pdf_renderer_control_stats = null;
                drag_area_tracker          = null;
                text_selection_manager     = null;
            });

            WPFDoEvents.SafeExec(() =>
            {
                DataContext = null;
            });

            ++dispose_count;

            //base.Dispose(disposing);     // parent only throws an exception (intentionally), so depart from best practices and don't call base.Dispose(bool)
        }
        /// <summary>
        /// Releases the unmanaged resources used by the <see cref="WrappingStream"/> and optionally releases the managed resources.
        /// </summary>
        /// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources.</param>
        protected override void Dispose(bool disposing)
        {
            Logging.Debug("WrappingStream::Dispose({0}) @{1}", disposing, dispose_count);

            WPFDoEvents.SafeExec(() =>
            {
                if (dispose_count == 0)
                {
                    // doesn't close the base stream, but just prevents access to it through this WrappingStream
                    m_streamBase = null;
                }

                base.Dispose(disposing);
            });

            ++dispose_count;
        }
Beispiel #25
0
        protected virtual void Dispose(bool disposing)
        {
            Logging.Debug("PDFSearchLayer::Dispose({0}) @{1}", disposing, dispose_count);

            WPFDoEvents.InvokeInUIThread(() =>
            {
                WPFDoEvents.SafeExec(() =>
                {
                    if (dispose_count == 0)
                    {
                        foreach (var el in Children)
                        {
                            IDisposable node = el as IDisposable;
                            if (null != node)
                            {
                                node.Dispose();
                            }
                        }
                    }
                });

                WPFDoEvents.SafeExec(() =>
                {
                    Children.Clear();
                });

                WPFDoEvents.SafeExec(() =>
                {
                    DataContext = null;

                    Dispatcher.ShutdownStarted -= Dispatcher_ShutdownStarted;
                });

                WPFDoEvents.SafeExec(() =>
                {
                    // Clear the references for sanity's sake
                    pdf_renderer_control = null;
                    search_result_set    = null;
                });

                ++dispose_count;

                //base.Dispose(disposing);     // parent only throws an exception (intentionally), so depart from best practices and don't call base.Dispose(bool)
            });
        }
Beispiel #26
0
        protected virtual void Dispose(bool disposing)
        {
            Logging.Debug("ReportViewerControl::Dispose({0}) @{1}", disposing, dispose_count);

            WPFDoEvents.SafeExec(() =>
            {
                // Get rid of managed resources
                ObjDocumentViewer.Document?.Blocks.Clear();
            }, must_exec_in_UI_thread: true);

            WPFDoEvents.SafeExec(() =>
            {
                ObjDocumentViewer.Document = null;
                annotation_report          = null;
            });

            ++dispose_count;
        }
Beispiel #27
0
            protected virtual void Dispose(bool disposing)
            {
                Logging.Debug("HDOCWrapper::Dispose({0}) @{1}", disposing, dispose_count);

                WPFDoEvents.SafeExec(() =>
                {
                    if (dispose_count == 0)
                    {
                        // Get rid of managed resources
                        if (IntPtr.Zero != HDOC)
                        {
                            SoraxDLL.SPD_Close(HDOC);
                            HDOC = IntPtr.Zero;
                        }
                    }
                });

                ++dispose_count;
            }
Beispiel #28
0
        protected virtual void Dispose(bool disposing)
        {
            Logging.Debug("AugmentedPdfLoadedDocument::Dispose({0}) @{1}", disposing, dispose_count);

            WPFDoEvents.SafeExec(() =>
            {
                if (dispose_count == 0)
                {
                    Close(true);
                }
            });

            WPFDoEvents.SafeExec(() =>
            {
                base.Dispose();
            });

            ++dispose_count;
        }
Beispiel #29
0
        public void Dispose()
        {
#if DIAG
            Logging.Debug("FolderWatcherManager::Dispose() @{0}", ++dispose_count);
#endif

            WPFDoEvents.SafeExec(() =>
            {
                //Utilities.LockPerfTimer l1_clk = Utilities.LockPerfChecker.Start();
                lock (folder_watcher_records_lock)
                {
                    //l1_clk.LockPerfTimerStop();
                    // Dispose of all the folder watchers
                    foreach (var folder_watcher_record in folder_watcher_records)
                    {
                        folder_watcher_record.Value.folder_watcher.Dispose();
                    }
                    folder_watcher_records.Clear();
                }
            });

            WPFDoEvents.SafeExec(() =>
            {
                Utilities.Maintainable.MaintainableManager.Instance.CleanupEntry(managed_thread_index);
            });

            WPFDoEvents.SafeExec(() =>
            {
                //Library.Dispose();
                web_library_detail = null;
            });

            WPFDoEvents.SafeExec(() =>
            {
                // Utilities.LockPerfTimer l2_clk = Utilities.LockPerfChecker.Start();
                lock (filenames_processed_lock)
                {
                    // l2_clk.LockPerfTimerStop();
                    filenames_processed.Clear();
                }
            });
        }
Beispiel #30
0
        protected virtual void Dispose(bool disposing)
        {
            Logging.Debug("LibraryIndex::Dispose({0}) @{1}", disposing, dispose_count);

            WPFDoEvents.SafeExec(() =>
            {
                if (dispose_count == 0)
                {
                    // Get rid of managed resources
                    // Utilities.LockPerfTimer l1_clk = Utilities.LockPerfChecker.Start();
                    lock (word_index_manager_lock)
                    {
                        // l1_clk.LockPerfTimerStop();

                        word_index_manager?.Dispose();
                        word_index_manager = null;
                    }

                    //this.library?.Dispose();
                }
            });

            WPFDoEvents.SafeExec(() =>
            {
                //this.word_index_manager = null;
                library = null;
            });

            WPFDoEvents.SafeExec(() =>
            {
                //Utilities.LockPerfTimer l4_clk = Utilities.LockPerfChecker.Start();
                lock (pdf_documents_in_library_lock)
                {
                    //l4_clk.LockPerfTimerStop();

                    pdf_documents_in_library?.Clear();
                    pdf_documents_in_library = null;
                }
            });

            ++dispose_count;
        }