Skip to content

Commit

Permalink
part of IDisposable cleanup work following the advice of the MSVS Cod…
Browse files Browse the repository at this point in the history
…e Analysis Report as much as possible (mostly the first bunch of CA2000 report lines) :

* Message	IDE0067	Disposable object created by 'new FolderBrowserDialog()' is never disposed
* Message	IDE0067	Disposable object created by 'new Tesseract()' is never disposed
* Message	IDE0067	Disposable object created by 'out ms_image' is never disposed
* Warning	CA1001	Implement IDisposable on 'BibTeXEditorControl' because it creates members of the following IDisposable types: 'WeakDependencyPropertyChangeNotifier'. If 'BibTeXEditorControl' has previously shipped, adding new members that implement IDisposable to this type is considered a breaking change to existing consumers.
* Warning	CA1001	Implement IDisposable on 'CSLProcessorOutputConsumer' because it creates members of the following IDisposable types: 'GeckoWebBrowser'. If 'CSLProcessorOutputConsumer' has previously shipped, adding new members that implement IDisposable to this type is considered a breaking change to existing consumers.
* Warning	CA1001	Implement IDisposable on 'FolderWatcher' because it creates members of the following IDisposable types: 'FileSystemWatcher'. If 'FolderWatcher' has previously shipped, adding new members that implement IDisposable to this type is considered a breaking change to existing consumers.
* Warning	CA1001	Implement IDisposable on 'GoogleBibTexSnifferControl' because it creates members of the following IDisposable types: 'PDFRendererControl'. If 'GoogleBibTexSnifferControl' has previously shipped, adding new members that implement IDisposable to this type is considered a breaking change to existing consumers.
* Warning	CA1001	Implement IDisposable on 'HtmlLexicalAnalyzer' because it creates members of the following IDisposable types: 'StringReader'.
* Warning	CA1001	Implement IDisposable on 'Library' because it creates members of the following IDisposable types: 'LibraryIndex'. If 'Library' has previously shipped, adding new members that implement IDisposable to this type is considered a breaking change to existing consumers.
* Warning	CA1001	Implement IDisposable on 'LibraryCatalogOverviewControl' because it creates members of the following IDisposable types: 'LibraryIndexHoverPopup'. If 'LibraryCatalogOverviewControl' has previously shipped, adding new members that implement IDisposable to this type is considered a breaking change to existing consumers.
* Warning	CA1001	Implement IDisposable on 'MainWindow' because it creates members of the following IDisposable types: 'StartPageControl'. If 'MainWindow' has previously shipped, adding new members that implement IDisposable to this type is considered a breaking change to existing consumers.
* Warning	CA1001	Implement IDisposable on 'NotificationManager' because it creates members of the following IDisposable types: 'ReaderWriterLockSlim', 'AutoResetEvent'. If 'NotificationManager' has previously shipped, adding new members that implement IDisposable to this type is considered a breaking change to existing consumers.
* Warning	CA1001	Implement IDisposable on 'PDFAnnotationNodeContentControl' because it creates members of the following IDisposable types: 'LibraryIndexHoverPopup'. If 'PDFAnnotationNodeContentControl' has previously shipped, adding new members that implement IDisposable to this type is considered a breaking change to existing consumers.
* Warning	CA1001	Implement IDisposable on 'PDFDocumentNodeContentControl' because it creates members of the following IDisposable types: 'LibraryIndexHoverPopup'. If 'PDFDocumentNodeContentControl' has previously shipped, adding new members that implement IDisposable to this type is considered a breaking change to existing consumers.
* Warning	CA1001	Implement IDisposable on 'PDFPrinterDocumentPaginator' because it creates members of the following IDisposable types: 'DocumentPage'.
* Warning	CA1001	Implement IDisposable on 'ReadOutLoudManager' because it creates members of the following IDisposable types: 'SpeechSynthesizer'. If 'ReadOutLoudManager' has previously shipped, adding new members that implement IDisposable to this type is considered a breaking change to existing consumers.
* Warning	CA1001	Implement IDisposable on 'TagEditorControl' because it creates members of the following IDisposable types: 'WeakDependencyPropertyChangeNotifier'. If 'TagEditorControl' has previously shipped, adding new members that implement IDisposable to this type is considered a breaking change to existing consumers.
* Warning	CA1001	Implement IDisposable on 'UrlDownloader.DownloadAsyncTracker' because it creates members of the following IDisposable types: 'UrlDownloader.WebClientWithCompression'. If 'UrlDownloader.DownloadAsyncTracker' has previously shipped, adding new members that implement IDisposable to this type is considered a breaking change to existing consumers.
* Warning	CA1063	Modify 'AugmentedPdfLoadedDocument.Dispose()' so that it calls Dispose(true), then calls GC.SuppressFinalize on the current object instance ('this' or 'Me' in Visual Basic), and then returns.
* Warning	CA1063	Modify 'AugmentedPdfLoadedDocument.~AugmentedPdfLoadedDocument()' so that it calls Dispose(false) and then returns.
* Warning	CA1063	Modify 'AugmentedPopupAutoCloser.Dispose()' so that it calls Dispose(true), then calls GC.SuppressFinalize on the current object instance ('this' or 'Me' in Visual Basic), and then returns.
* Warning	CA1063	Modify 'AugmentedPopupAutoCloser.~AugmentedPopupAutoCloser()' so that it calls Dispose(false) and then returns.
* Warning	CA1063	Modify 'BrainstormControl.Dispose()' so that it calls Dispose(true), then calls GC.SuppressFinalize on the current object instance ('this' or 'Me' in Visual Basic), and then returns.
* Warning	CA1063	Modify 'BrainstormControl.~BrainstormControl()' so that it calls Dispose(false) and then returns.
* Warning	CA1063	Modify 'ChatControl.Dispose()' so that it calls Dispose(true), then calls GC.SuppressFinalize on the current object instance ('this' or 'Me' in Visual Basic), and then returns.
* Warning	CA1063	Modify 'ChatControl.~ChatControl()' so that it calls Dispose(false) and then returns.
* Warning	CA1063	Modify 'LibraryIndex.Dispose()' so that it calls Dispose(true), then calls GC.SuppressFinalize on the current object instance ('this' or 'Me' in Visual Basic), and then returns.
* Warning	CA1063	Modify 'LibraryIndex.~LibraryIndex()' so that it calls Dispose(false) and then returns.
* Warning	CA1063	Modify 'LibraryIndexHoverPopup.Dispose()' so that it calls Dispose(true), then calls GC.SuppressFinalize on the current object instance ('this' or 'Me' in Visual Basic), and then returns.
* Warning	CA1063	Modify 'LibraryIndexHoverPopup.~LibraryIndexHoverPopup()' so that it calls Dispose(false) and then returns.
* Warning	CA1063	Modify 'LuceneIndex.Dispose()' so that it calls Dispose(true), then calls GC.SuppressFinalize on the current object instance ('this' or 'Me' in Visual Basic), and then returns.
* Warning	CA1063	Modify 'LuceneIndex.~LuceneIndex()' so that it calls Dispose(false) and then returns.
* Warning	CA1063	Modify 'PDFReadingControl.Dispose()' so that it calls Dispose(true), then calls GC.SuppressFinalize on the current object instance ('this' or 'Me' in Visual Basic), and then returns.
* Warning	CA1063	Modify 'PDFReadingControl.~PDFReadingControl()' so that it calls Dispose(false) and then returns.
* Warning	CA1063	Modify 'PDFRendererControl.Dispose()' so that it calls Dispose(true), then calls GC.SuppressFinalize on the current object instance ('this' or 'Me' in Visual Basic), and then returns.
* Warning	CA1063	Modify 'PDFRendererControl.~PDFRendererControl()' so that it calls Dispose(false) and then returns.
* Warning	CA1063	Modify 'ProcessOutputReader.Dispose()' so that it calls Dispose(true), then calls GC.SuppressFinalize on the current object instance ('this' or 'Me' in Visual Basic), and then returns.
* Warning	CA1063	Modify 'ProcessOutputReader.~ProcessOutputReader()' so that it calls Dispose(false) and then returns.
* Warning	CA1063	Modify 'ReportViewerControl.Dispose()' so that it calls Dispose(true), then calls GC.SuppressFinalize on the current object instance ('this' or 'Me' in Visual Basic), and then returns.
* Warning	CA1063	Modify 'ReportViewerControl.~ReportViewerControl()' so that it calls Dispose(false) and then returns.
* Warning	CA1063	Modify 'SceneRenderingControl.Dispose()' so that it calls Dispose(true), then calls GC.SuppressFinalize on the current object instance ('this' or 'Me' in Visual Basic), and then returns.
* Warning	CA1063	Modify 'SceneRenderingControl.~SceneRenderingControl()' so that it calls Dispose(false) and then returns.
* Warning	CA1063	Modify 'SpeedReadControl.Dispose()' so that it calls Dispose(true), then calls GC.SuppressFinalize on the current object instance ('this' or 'Me' in Visual Basic), and then returns.
* Warning	CA1063	Modify 'SpeedReadControl.~SpeedReadControl()' so that it calls Dispose(false) and then returns.
* Warning	CA1063	Modify 'StartPageControl.Dispose()' so that it calls Dispose(true), then calls GC.SuppressFinalize on the current object instance ('this' or 'Me' in Visual Basic), and then returns.
* Warning	CA1063	Modify 'StartPageControl.~StartPageControl()' so that it calls Dispose(false) and then returns.
* Warning	CA1063	Modify 'StopWatch.Dispose()' so that it calls Dispose(true), then calls GC.SuppressFinalize on the current object instance ('this' or 'Me' in Visual Basic), and then returns.
* Warning	CA1063	Modify 'StopWatch.~StopWatch()' so that it calls Dispose(false) and then returns.
* Warning	CA1063	Modify 'WebBrowserControl.Dispose()' so that it calls Dispose(true), then calls GC.SuppressFinalize on the current object instance ('this' or 'Me' in Visual Basic), and then returns.
* Warning	CA1063	Modify 'WebBrowserControl.~WebBrowserControl()' so that it calls Dispose(false) and then returns.
* Warning	CA1063	Modify 'WebBrowserHostControl.Dispose()' so that it calls Dispose(true), then calls GC.SuppressFinalize on the current object instance ('this' or 'Me' in Visual Basic), and then returns.
* Warning	CA1063	Modify 'WebBrowserHostControl.~WebBrowserHostControl()' so that it calls Dispose(false) and then returns.
* Warning	CA2000	In method 'AssociatePDFWithVanillaReferenceWindow.CmdLocal_Click(object, RoutedEventArgs)', call System.IDisposable.Dispose on object 'new OpenFileDialog()' before all references to it are out of scope.
* Warning	CA2000	In method 'BibTexExport.Export(List<PDFDocument>)', call System.IDisposable.Dispose on object 'new SaveFileDialog()' before all references to it are out of scope.
* Warning	CA2000	In method 'BitmapImageTools.CropImageRegion(Image, double, double, double, double)', call System.IDisposable.Dispose on object 'bitmap' before all references to it are out of scope.
* Warning	CA2000	In method 'BitmapImageTools.FromImage(Image)', object 'ms' is not disposed along all exception paths. Call System.IDisposable.Dispose on object 'ms' before all references to it are out of scope.
* Warning	CA2000	In method 'BrowserStarter.OpenBrowser_REGISTRY(string)', call System.IDisposable.Dispose on object 'p' before all references to it are out of scope.
* Warning	CA2000	In method 'ChartTools.renderNoDatasetMessage(Graphics)', call System.IDisposable.Dispose on object 'font' before all references to it are out of scope.
* Warning	CA2000	In method 'ClipboardTools.SetRtf(string)', call System.IDisposable.Dispose on object 'rich_text_box' before all references to it are out of scope.
* Warning	CA2000	In method 'ConsoleRedirector.CaptureConsole()', call System.IDisposable.Dispose on object 'cr' before all references to it are out of scope.
* Warning	CA2000	In method 'CSLEditorControl.OnBibliographyReady(CSLProcessorOutputConsumer)', call System.IDisposable.Dispose on object 'ms' before all references to it are out of scope.
* Warning	CA2000	In method 'DocumentConversion.ConvertorDOC(string, string)', call System.IDisposable.Dispose on object 'converter' before all references to it are out of scope.
* Warning	CA2000	In method 'DocumentConversion.ConvertorDOC(string, string)', call System.IDisposable.Dispose on object 'word_document' before all references to it are out of scope.
* Warning	CA2000	In method 'ExportToWord.ExportToTextAndLaunch(PDFDocument)', call System.IDisposable.Dispose on object 'report_view_control' before all references to it are out of scope.
* Warning	CA2000	In method 'FolderWatcherChooser.CmdAddFolder_Click(object, RoutedEventArgs)', call System.IDisposable.Dispose on object 'new FolderBrowserDialog()' before all references to it are out of scope.
* Warning	CA2000	In method 'Fonts.getLargestFont(Graphics, string, double)', object 'font' is not disposed along all exception paths. Call System.IDisposable.Dispose on object 'font' before all references to it are out of scope.
* Warning	CA2000	In method 'Ghostscript.RenderPage_AsMemoryStream(string, int, int, string, ProcessPriorityClass)', object 'ms' is not disposed along all exception paths. Call System.IDisposable.Dispose on object 'ms' before all references to it are out of scope.
* Warning	CA2000	In method 'GoogleAnalysicsSubmitter.Submit_BACKGROUND(Feature)', call System.IDisposable.Dispose on object 'wc' before all references to it are out of scope.
* Warning	CA2000	In method 'GoogleScholarScraper.ScrapeUrl(IWebProxy, string)', call System.IDisposable.Dispose on object 'ms' before all references to it are out of scope.
* Warning	CA2000	In method 'GUITools.RenderToBitmapImage(UIElement)', object 'ms' is not disposed along all exception paths. Call System.IDisposable.Dispose on object 'ms' before all references to it are out of scope.
* Warning	CA2000	In method 'HtmlFromXamlConverter.ConvertXamlToHtml(string)', call System.IDisposable.Dispose on object 'new StringReader(xamlString)' before all references to it are out of scope.
* Warning	CA2000	In method 'HtmlFromXamlConverter.ConvertXamlToHtml(string)', call System.IDisposable.Dispose on object 'new StringWriter(htmlStringBuilder)' before all references to it are out of scope.
* Warning	CA2000	In method 'ImportFromFolder.FolderLocationButton_Click(object, RoutedEventArgs)', call System.IDisposable.Dispose on object 'new FolderBrowserDialog()' before all references to it are out of scope.
* Warning	CA2000	In method 'ImportFromThirdParty.GetFolderNameFromDialog(string, string)', call System.IDisposable.Dispose on object 'ofd' before all references to it are out of scope.
* Warning	CA2000	In method 'IntranetLibraryChooserControl.ObjButtonFolderChoose_Click(object, RoutedEventArgs)', call System.IDisposable.Dispose on object 'new FolderBrowserDialog()' before all references to it are out of scope.
* Warning	CA2000	In method 'IPCServer.StartServerPump()', call System.IDisposable.Dispose on object 'npss' before all references to it are out of scope.
* Warning	CA2000	In method 'LibraryBundleCreationControl.CmdCreateBundle_Click(object, RoutedEventArgs)', call System.IDisposable.Dispose on object 'dialog' before all references to it are out of scope.
* Warning	CA2000	In method 'LibraryControl.ButtonAddDocuments_Click(object, RoutedEventArgs)', call System.IDisposable.Dispose on object 'new OpenFileDialog()' before all references to it are out of scope.
* Warning	CA2000	In method 'LibraryExporter.Export(Library, List<PDFDocument>)', call System.IDisposable.Dispose on object 'new FolderBrowserDialog()' before all references to it are out of scope.
* Warning	CA2000	In method 'LibraryIndexHoverPopup.DisplayThumbnail()', call System.IDisposable.Dispose on object 'new MemoryStream(this.pdf_document.PDFRenderer.GetPageByHeightAsImage(this.page, (this.ImageThumbnail.Height / IMAGE_PERCENTAGE)))' before all references to it are out of scope.
* Warning	CA2000	In method 'LuceneIndex.GetDocumentPagesWithQuery(string)', call System.IDisposable.Dispose on object 'index_reader' before all references to it are out of scope.
* Warning	CA2000	In method 'LuceneIndex.GetDocumentPagesWithQuery(string)', call System.IDisposable.Dispose on object 'index_searcher' before all references to it are out of scope.
* Warning	CA2000	In method 'LuceneIndex.GetDocumentsSimilarToDocument(string)', call System.IDisposable.Dispose on object 'index_reader' before all references to it are out of scope.
* Warning	CA2000	In method 'LuceneIndex.GetDocumentsSimilarToDocument(string)', call System.IDisposable.Dispose on object 'index_searcher' before all references to it are out of scope.
* Warning	CA2000	In method 'LuceneIndex.GetDocumentsSimilarToDocument(string)', call System.IDisposable.Dispose on object 'new StreamReader(document_filename)' before all references to it are out of scope.
* Warning	CA2000	In method 'LuceneIndex.GetDocumentsWithQuery(string)', call System.IDisposable.Dispose on object 'index_reader' before all references to it are out of scope.
* Warning	CA2000	In method 'LuceneIndex.GetDocumentsWithQuery(string)', call System.IDisposable.Dispose on object 'index_searcher' before all references to it are out of scope.
* Warning	CA2000	In method 'LuceneIndex.GetDocumentsWithWord(string)', call System.IDisposable.Dispose on object 'index_reader' before all references to it are out of scope.
* Warning	CA2000	In method 'LuceneIndex.GetDocumentsWithWord(string)', call System.IDisposable.Dispose on object 'index_searcher' before all references to it are out of scope.
* Warning	CA2000	In method 'LuceneMoreLikeThis.Like(FileInfo)', call System.IDisposable.Dispose on object 'new StreamReader(f.FullName, Encoding.Default)' before all references to it are out of scope.
* Warning	CA2000	In method 'LuceneMoreLikeThis.Main(string[])', call System.IDisposable.Dispose on object 'Console.OpenStandardOutput()' before all references to it are out of scope.
* Warning	CA2000	In method 'LuceneMoreLikeThis.Main(string[])', call System.IDisposable.Dispose on object 'r' before all references to it are out of scope.
* Warning	CA2000	In method 'LuceneMoreLikeThis.Main(string[])', call System.IDisposable.Dispose on object 'searcher' before all references to it are out of scope.
* Warning	CA2000	In method 'LuceneMoreLikeThis.RetrieveTerms(int)', call System.IDisposable.Dispose on object 'new StreamReader(text[j])' before all references to it are out of scope.
* Warning	CA2000	In method 'LuceneSimilarityQueries.FormSimilarQuery(string, Analyzer, string, Hashtable)', call System.IDisposable.Dispose on object 'new StringReader(body)' before all references to it are out of scope.
* Warning	CA2000	In method 'MainWindowServiceDispatcher.OnShowTagOptionsComplete(Library, List<PDFDocument>, AnnotationReportOptionsWindow.AnnotationReportOptions)', call System.IDisposable.Dispose on object 'report_view_control' before all references to it are out of scope.
* Warning	CA2000	In method 'MainWindowServiceDispatcher.OpenDocument(PDFDocument, int?, string, bool)', object 'pdf_reading_control' is not disposed along all exception paths. Call System.IDisposable.Dispose on object 'pdf_reading_control' before all references to it are out of scope.
* Warning	CA2000	In method 'MainWindowServiceDispatcher.OpenNewBrainstorm()', object 'brainstorm_control' is not disposed along all exception paths. Call System.IDisposable.Dispose on object 'brainstorm_control' before all references to it are out of scope.
* Warning	CA2000	In method 'MainWindowServiceDispatcher.OpenSampleBrainstorm()', object 'brainstorm_control' is not disposed along all exception paths. Call System.IDisposable.Dispose on object 'brainstorm_control' before all references to it are out of scope.
* Warning	CA2000	In method 'MainWindowServiceDispatcher.OpenSpeedRead()', object 'src' is not disposed along all exception paths. Call System.IDisposable.Dispose on object 'src' before all references to it are out of scope.
* Warning	CA2000	In method 'MainWindowServiceDispatcher.OpenWebBrowser()', object 'web_browser_control' is not disposed along all exception paths. Call System.IDisposable.Dispose on object 'web_browser_control' before all references to it are out of scope.
* Warning	CA2000	In method 'MultiChart2D.performPaintY1Axis(Graphics, ChartRegion, ChartRegion, Point2D, Point2D)', call System.IDisposable.Dispose on object 'string_format' before all references to it are out of scope.
* Warning	CA2000	In method 'MultiChart2D.performPaintY2Axis(Graphics, ChartRegion, ChartRegion, Point2D, Point2D)', call System.IDisposable.Dispose on object 'string_format' before all references to it are out of scope.
* Warning	CA2000	In method 'MuPDFRenderer.ReadEntireStandardOutput(string, ProcessPriorityClass)', object 'ms' is not disposed along all exception paths. Call System.IDisposable.Dispose on object 'ms' before all references to it are out of scope.
* Warning	CA2000	In method 'MYDDatabase.OpenMYDDatabase(string)', object 'ms' is not disposed along all exception paths. Call System.IDisposable.Dispose on object 'ms' before all references to it are out of scope.
* Warning	CA2000	In method 'OCREngine.DoOCR(string, int)', call System.IDisposable.Dispose on object 'new MemoryStream(renderer.GetPageByDPIAsImage(page_number, 200F))' before all references to it are out of scope.
* Warning	CA2000	In method 'PDFAnnotationToImageRenderer.RenderAnnotation(PDFDocument, PDFAnnotation, float)', call System.IDisposable.Dispose on object 'new MemoryStream(pdf_document.PDFRenderer.GetPageByDPIAsImage(pdf_annotation.Page, dpi))' before all references to it are out of scope.
* Warning	CA2000	In method 'PDFCameraLayer.GetSnappedImage(Point, Point)', call System.IDisposable.Dispose on object 'new MemoryStream(this.pdf_renderer_control_stats.pdf_document.PDFRenderer.GetPageByDPIAsImage(this.page, 150F))' before all references to it are out of scope.
* Warning	CA2000	In method 'PDFInterceptor.Response(HttpChannel)', call System.IDisposable.Dispose on object 'stream_listener_tee' before all references to it are out of scope.
* Warning	CA2000	In method 'PDFOverlayRenderer.RenderAnnotations(Image, PDFDocument, int, PDFAnnotation)', call System.IDisposable.Dispose on object 'highlight_pen' before all references to it are out of scope.
* Warning	CA2000	In method 'PDFOverlayRenderer.RenderHighlights(Image, PDFDocument, int)', call System.IDisposable.Dispose on object 'image_attributes' before all references to it are out of scope.
* Warning	CA2000	In method 'PDFOverlayRenderer.RenderHighlights(int, int, PDFDocument, int)', call System.IDisposable.Dispose on object 'highlight_pen' before all references to it are out of scope.
* Warning	CA2000	In method 'PDFOverlayRenderer.RenderHighlights(int, int, PDFDocument, int)', object 'bitmap' is not disposed along all exception paths. Call System.IDisposable.Dispose on object 'bitmap' before all references to it are out of scope.
* Warning	CA2000	In method 'PDFPrinterDocumentPaginator.GetPage(int)', call System.IDisposable.Dispose on object 'new MemoryStream(this.pdf_renderer.GetPageByDPIAsImage(page, 300F))' before all references to it are out of scope.
* Warning	CA2000	In method 'PDFTextExtractor.GetNextJob()', call System.IDisposable.Dispose on object 'new PDFTextExtractor.NextJob(this, job, false, this.queue_lock)' before all references to it are out of scope.
* Warning	CA2000	In method 'PDFTextExtractor.GetNextJob()', call System.IDisposable.Dispose on object 'new PDFTextExtractor.NextJob(this, job, false, this.queue_lock)' before all references to it are out of scope.
* Warning	CA2000	In method 'PDFTextExtractor.GetNextJob()', call System.IDisposable.Dispose on object 'new PDFTextExtractor.NextJob(this, job, false, this.queue_lock)' before all references to it are out of scope.
* Warning	CA2000	In method 'PDFTextExtractor.GetNextJob()', call System.IDisposable.Dispose on object 'new PDFTextExtractor.NextJob(this, job, false, this.queue_lock)' before all references to it are out of scope.
* Warning	CA2000	In method 'PDFTextExtractor.GetNextJob()', call System.IDisposable.Dispose on object 'new PDFTextExtractor.NextJob(this, job, false, this.queue_lock)' before all references to it are out of scope.
* Warning	CA2000	In method 'PDFTextExtractor.GetNextJob()', call System.IDisposable.Dispose on object 'new PDFTextExtractor.NextJob(this, job, false, this.queue_lock)' before all references to it are out of scope.
* Warning	CA2000	In method 'PDFTextExtractor.GetNextJob()', call System.IDisposable.Dispose on object 'new PDFTextExtractor.NextJob(this, job, true, this.queue_lock)' before all references to it are out of scope.
* Warning	CA2000	In method 'PkiEncryption.Decrypt(string, string)', call System.IDisposable.Dispose on object 'rsaProvider' before all references to it are out of scope.
* Warning	CA2000	In method 'PkiEncryption.Encrypt(string, string)', call System.IDisposable.Dispose on object 'rsaProvider' before all references to it are out of scope.
* Warning	CA2000	In method 'PkiEncryption.GenerateKeys(out string, out string)', call System.IDisposable.Dispose on object 'rsaProvider' before all references to it are out of scope.
* Warning	CA2000	In method 'PNMLoader.CreateBitmapOffSize()', object 'bitmap' is not disposed along all exception paths. Call System.IDisposable.Dispose on object 'bitmap' before all references to it are out of scope.
* Warning	CA2000	In method 'PNMLoader.CreateGreyMap()', object 'bitmap' is not disposed along all exception paths. Call System.IDisposable.Dispose on object 'bitmap' before all references to it are out of scope.
* Warning	CA2000	In method 'PNMLoader.CreateGreyMapOffSize(byte[])', object 'bitmap' is not disposed along all exception paths. Call System.IDisposable.Dispose on object 'bitmap' before all references to it are out of scope.
* Warning	CA2000	In method 'PNMLoader.PNMLoader(string)', object 'stream' is not disposed along all exception paths. Call System.IDisposable.Dispose on object 'stream' before all references to it are out of scope.
* Warning	CA2000	In method 'ProcessSpawning.SpawnChildProcess(string, string, ProcessPriorityClass)', object 'process' is not disposed along all exception paths. Call System.IDisposable.Dispose on object 'process' before all references to it are out of scope.
* Warning	CA2000	In method 'ReversibleEncryption.Decrypt(byte[])', object 'encryptedStream' is not disposed along all exception paths. Call System.IDisposable.Dispose on object 'encryptedStream' before all references to it are out of scope.
* Warning	CA2000	In method 'ReversibleEncryption.Encrypt(string)', object 'memoryStream' is not disposed along all exception paths. Call System.IDisposable.Dispose on object 'memoryStream' before all references to it are out of scope.
* Warning	CA2000	In method 'ReversibleEncryption.ReversibleEncryption()', call System.IDisposable.Dispose on object 'rm' before all references to it are out of scope.
* Warning	CA2000	In method 'SerializeFile.ProtoSaveToByteArray<T>(T)', call System.IDisposable.Dispose on object 'ms' before all references to it are out of scope.
* Warning	CA2000	In method 'SoraxPDFRendererDLLWrapper.GetPageByDPIAsImage_LOCK(SoraxPDFRendererDLLWrapper.HDOCWrapper, int, float)', call System.IDisposable.Dispose on object 'ms' before all references to it are out of scope.
* Warning	CA2000	In method 'StreamFingerprint.FromStream_DOTNET(Stream)', call System.IDisposable.Dispose on object 'sha1' before all references to it are out of scope.
* Warning	CA2000	In method 'StreamFingerprint.FromText(string)', call System.IDisposable.Dispose on object 'ms' before all references to it are out of scope.
* Warning	CA2000	In method 'StreamMD5.FromBytes(byte[])', call System.IDisposable.Dispose on object 'ms' before all references to it are out of scope.
* Warning	CA2000	In method 'StreamMD5.FromStream(Stream)', call System.IDisposable.Dispose on object 'md5' before all references to it are out of scope.
* Warning	CA2000	In method 'StreamMD5.FromText(string)', call System.IDisposable.Dispose on object 'ms' before all references to it are out of scope.
* Warning	CA2000	In method 'StreamToFile.CopyBufferToStream(Stream, byte[], int)', call System.IDisposable.Dispose on object 'ms' before all references to it are out of scope.
* Warning	CA2000	In method 'TopographicalChart.OnPaint(PaintEventArgs)', call System.IDisposable.Dispose on object 'brush' before all references to it are out of scope.
* Warning	CA2000	In method 'TopographicalChart.OnPaint(PaintEventArgs)', call System.IDisposable.Dispose on object 'font' before all references to it are out of scope.
* Warning	CA2000	In method 'TopographicalChart.showForm()', call System.IDisposable.Dispose on object 'form' before all references to it are out of scope.
* Warning	CA2000	In method 'TopographicalChart.showFormModal()', call System.IDisposable.Dispose on object 'form' before all references to it are out of scope.
* Warning	CA2000	In method 'TweetControl.GenerateRtfCitationSnippet_OnBibliographyReady(CSLProcessorOutputConsumer)', call System.IDisposable.Dispose on object 'rich_text_box' before all references to it are out of scope.
* Warning	CA2000	In method 'WebBrowserHostControl.OpenNewWindow()', object 'wbc' is not disposed along all exception paths. Call System.IDisposable.Dispose on object 'wbc' before all references to it are out of scope.
* Warning	CA2000	In method 'WebLibraryDetailControl.GenericCustomiseChooser(string, string)', call System.IDisposable.Dispose on object 'dialog' before all references to it are out of scope.
* Warning	CA2000	In method 'WebLibraryDetailControl.UpdateLibraryStatistics_Stats_Background_CoverFlow()', call System.IDisposable.Dispose on object 'font' before all references to it are out of scope.
* Warning	CA2000	In method 'WebLibraryDetailControl.UpdateLibraryStatistics_Stats_Background_CoverFlow()', call System.IDisposable.Dispose on object 'image_attributes' before all references to it are out of scope.
* Warning	CA2000	In method 'WebLibraryDetailControl.UpdateLibraryStatistics_Stats_Background_CoverFlow()', call System.IDisposable.Dispose on object 'mat' before all references to it are out of scope.
* Warning	CA2000	In method 'WebLibraryDetailControl.UpdateLibraryStatistics_Stats_Background_CoverFlow()', call System.IDisposable.Dispose on object 'new MemoryStream(base.Current.pdf_document.PDFRenderer.GetPageByHeightAsImage(1, (WebLibraryDetailControl.PREVIEW_IMAGE_HEIGHT / WebLibraryDetailControl.PREVIEW_IMAGE_PERCENTAGE)))' before all references to it are out of scope.
* Warning	CA2000	In method 'WebLibraryDetailControl.UpdateLibraryStatistics_Stats_Background_CoverFlow()', call System.IDisposable.Dispose on object 'new StringFormat()' before all references to it are out of scope.
* Warning	CA2000	In method 'WebsiteAccess.DownloadFile(WebsiteAccess.OurSiteFileKind)', call System.IDisposable.Dispose on object 'web_client' before all references to it are out of scope.
* Warning	CA2000	In method 'Word2007Export.Export(List<PDFDocument>)', call System.IDisposable.Dispose on object 'new SaveFileDialog()' before all references to it are out of scope.
* Warning	CA2000	In method 'XMLTools.ToString(XmlDocument)', call System.IDisposable.Dispose on object 'sw' before all references to it are out of scope.
* Warning	CA2202	Object 'app_key' can be disposed more than once in method 'UserRegistry.Read(string)'. To avoid generating a System.ObjectDisposedException you should not call Dispose more than one time on an object.: Lines: 39
* Warning	CA2202	Object 'app_key' can be disposed more than once in method 'UserRegistry.Write(string, string)'. To avoid generating a System.ObjectDisposedException you should not call Dispose more than one time on an object.: Lines: 28
* Warning	CA2202	Object 'compressed_stream' can be disposed more than once in method 'PostcodeOutcodes.PostcodeOutcodes()'. To avoid generating a System.ObjectDisposedException you should not call Dispose more than one time on an object.: Lines: 80
* Warning	CA2202	Object 'compressed_stream' can be disposed more than once in method 'ScrabbleWords.CreateWords()'. To avoid generating a System.ObjectDisposedException you should not call Dispose more than one time on an object.: Lines: 125
* Warning	CA2202	Object 'compressed_stream' can be disposed more than once in method 'ScrabbleWords.CreateWords()'. To avoid generating a System.ObjectDisposedException you should not call Dispose more than one time on an object.: Lines: 148
* Warning	CA2202	Object 'compressed_stream' can be disposed more than once in method 'ScrabbleWords.ScrabbleWords()'. To avoid generating a System.ObjectDisposedException you should not call Dispose more than one time on an object.: Lines: 36
* Warning	CA2202	Object 'fs' can be disposed more than once in method 'BibTeXImporter.BibTeXImporter(Library, string)'. To avoid generating a System.ObjectDisposedException you should not call Dispose more than one time on an object.: Lines: 37
* Warning	CA2202	Object 'fs' can be disposed more than once in method 'ImportingIntoLibrary.AddNewDocumentToLibraryFromInternet_SYNCHRONOUS(Library, object)'. To avoid generating a System.ObjectDisposedException you should not call Dispose more than one time on an object.: Lines: 285
* Warning	CA2202	Object 'fs' can be disposed more than once in method 'LDASampler.FastLoad(string, int[][])'. To avoid generating a System.ObjectDisposedException you should not call Dispose more than one time on an object.: Lines: 218
* Warning	CA2202	Object 'fs' can be disposed more than once in method 'LDASampler.FastSave(string)'. To avoid generating a System.ObjectDisposedException you should not call Dispose more than one time on an object.: Lines: 176
* Warning	CA2202	Object 'fs' can be disposed more than once in method 'UnhandledExceptionMessageBox.PopulateLog()'. To avoid generating a System.ObjectDisposedException you should not call Dispose more than one time on an object.: Lines: 213
* Warning	CA2202	Object 'fs' can be disposed more than once in method 'VisualGalleryControl.ExportJpegImage(PdfDictionary, ref int)'. To avoid generating a System.ObjectDisposedException you should not call Dispose more than one time on an object.: Lines: 64
* Warning	CA2202	Object 'memoryStream' can be disposed more than once in method 'ReversibleEncryption.Encrypt(string)'. To avoid generating a System.ObjectDisposedException you should not call Dispose more than one time on an object.: Lines: 95
* Warning	CA2202	Object 'npss_in_callback' can be disposed more than once in method 'IPCServer.StartServerPump()'. To avoid generating a System.ObjectDisposedException you should not call Dispose more than one time on an object.: Lines: 66
* Warning	CA2202	Object 'stream' can be disposed more than once in method 'CSLProcessorTranslator_AbbreviationsManager.LoadDefaultAbbreviations()'. To avoid generating a System.ObjectDisposedException you should not call Dispose more than one time on an object.: Lines: 80
* Warning	CA2202	Object 'stream' can be disposed more than once in method 'PostcodeOutcodes.PostcodeOutcodes()'. To avoid generating a System.ObjectDisposedException you should not call Dispose more than one time on an object.: Lines: 80
* Warning	CA2202	Object 'stream' can be disposed more than once in method 'ScrabbleWords.CreateWords()'. To avoid generating a System.ObjectDisposedException you should not call Dispose more than one time on an object.: Lines: 125, 126
* Warning	CA2202	Object 'stream' can be disposed more than once in method 'ScrabbleWords.CreateWords()'. To avoid generating a System.ObjectDisposedException you should not call Dispose more than one time on an object.: Lines: 148, 149
* Warning	CA2202	Object 'stream' can be disposed more than once in method 'ScrabbleWords.ScrabbleWords()'. To avoid generating a System.ObjectDisposedException you should not call Dispose more than one time on an object.: Lines: 36
* Warning	CA2202	Object 'stream' can be disposed more than once in method 'SerializeFile.LoadCompressed(string)'. To avoid generating a System.ObjectDisposedException you should not call Dispose more than one time on an object.: Lines: 297
* Warning	CA2202	Object 'stream' can be disposed more than once in method 'SerializeFile.SaveCompressed(string, object)'. To avoid generating a System.ObjectDisposedException you should not call Dispose more than one time on an object.: Lines: 286
* Warning	CA2202	Object 'sub_app_key' can be disposed more than once in method 'UserRegistry.Read(string, string)'. To avoid generating a System.ObjectDisposedException you should not call Dispose more than one time on an object.: Lines: 77
* Warning	CA2202	Object 'sub_app_key' can be disposed more than once in method 'UserRegistry.Write(string, string, string)'. To avoid generating a System.ObjectDisposedException you should not call Dispose more than one time on an object.: Lines: 63
* Warning	CA2202	Object 'sw' can be disposed more than once in method 'PubMedXMLToBibTex.XMLNodeToPrettyString(XmlNode)'. To avoid generating a System.ObjectDisposedException you should not call Dispose more than one time on an object.: Lines: 119
* Warning	CA2213	'ChatControl' contains field 'ChatControl.timer' that is of IDisposable type: 'Timer'. Change the Dispose method on 'ChatControl' to call Dispose or Close on this field.
* Warning	CA2213	'LibraryIndex' contains field 'LibraryIndex.word_index_manager' that is of IDisposable type: 'LuceneIndex'. Change the Dispose method on 'LibraryIndex' to call Dispose or Close on this field.
* Warning	CA2213	'PDFReadingControl' contains field 'PDFReadingControl.pdf_renderer_control' that is of IDisposable type: 'PDFRendererControl'. Change the Dispose method on 'PDFReadingControl' to call Dispose or Close on this field.
* Warning	CA2213	'WebBrowserHostControl' contains field 'WebBrowserHostControl.wbc_browsing' that is of IDisposable type: 'WebBrowserControl'. Change the Dispose method on 'WebBrowserHostControl' to call Dispose or Close on this field.
  • Loading branch information
GerHobbelt committed Aug 7, 2019
1 parent a80be7d commit a540e50
Show file tree
Hide file tree
Showing 27 changed files with 493 additions and 399 deletions.
11 changes: 11 additions & 0 deletions Qiqqa/Brainstorm/Nodes/PDFAnnotationNodeContentControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ public partial class PDFAnnotationNodeContentControl : UserControl, IKeyPressabl
{
PDFAnnotationNodeContent pdf_annotation_node_content;

// TODO:
//
// Warning CA1001 Implement IDisposable on 'PDFAnnotationNodeContentControl' because it creates
// members of the following IDisposable types: 'LibraryIndexHoverPopup'.
// If 'PDFAnnotationNodeContentControl' has previously shipped, adding new members that implement
// IDisposable to this type is considered a breaking change to existing consumers.
//
// Note from GHO: that object is already managed through the sequence of tooltip_open and tooltip_close
// handlers below and is currently not considered a memory leak risk for https://github.com/jimmejardine/qiqqa-open-source/issues/19
// and there-abouts.

LibraryIndexHoverPopup library_index_hover_popup = null;

public PDFAnnotationNodeContentControl(NodeControl node_control, PDFAnnotationNodeContent pdf_annotation_node_content)
Expand Down
11 changes: 11 additions & 0 deletions Qiqqa/Brainstorm/Nodes/PDFDocumentNodeContentControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ public partial class PDFDocumentNodeContentControl : UserControl, IKeyPressableN
NodeControl node_control;
PDFDocumentNodeContent pdf_document_node_content;

// TODO:
//
// Warning CA1001 Implement IDisposable on 'PDFAnnotationNodeContentControl' because it creates
// members of the following IDisposable types: 'LibraryIndexHoverPopup'.
// If 'PDFAnnotationNodeContentControl' has previously shipped, adding new members that implement
// IDisposable to this type is considered a breaking change to existing consumers.
//
// Note from GHO: that object is already managed through the sequence of tooltip_open and tooltip_close
// handlers below and is currently not considered a memory leak risk for https://github.com/jimmejardine/qiqqa-open-source/issues/19
// and there-abouts.

LibraryIndexHoverPopup library_index_hover_popup = null;

public PDFDocumentNodeContentControl(NodeControl node_control, PDFDocumentNodeContent pdf_document_node_content)
Expand Down
15 changes: 11 additions & 4 deletions Qiqqa/Brainstorm/SceneManager/SceneRenderingControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,17 @@ private void DragDropClipboard_AddUrl(string url)
|| url_lower.EndsWith(".jpeg", StringComparison.CurrentCultureIgnoreCase)
)
{
MemoryStream ms_image;
UrlDownloader.DownloadWithBlocking(ConfigurationManager.Instance.Proxy, url, out ms_image);
ImageNodeContent inc = new ImageNodeContent(ms_image);
AddNewNodeControl(inc, mouse_current_virtual.X, mouse_current_virtual.Y);
MemoryStream ms_image = null;
try
{
UrlDownloader.DownloadWithBlocking(ConfigurationManager.Instance.Proxy, url, out ms_image);
ImageNodeContent inc = new ImageNodeContent(ms_image);
AddNewNodeControl(inc, mouse_current_virtual.X, mouse_current_virtual.Y);
}
finally
{
ms_image.Dispose();
}
}
else
{
Expand Down
152 changes: 77 additions & 75 deletions Qiqqa/Chat/ChatControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,81 +179,83 @@ class ChatRecord
private void ProcessDisplayResponse(MemoryStream ms)
{
// Process the lines
StreamReader sr = new StreamReader(ms);
List<ChatRecord> chat_records = new List<ChatRecord>();
{
string line;
ChatRecord last_chat_record = null;
while (null != (line = sr.ReadLine()))
{
string[] items = line.Split('\t');
{
last_chat_record = new ChatRecord();
last_chat_record.Timestamp = items[0];
last_chat_record.Forum = items[1];
last_chat_record.Username = items[2];
last_chat_record.Comment = items[3];
}
chat_records.Add(last_chat_record);
}

// Record the last epoch
if (null != last_chat_record)
{
last_epoch = last_chat_record.Timestamp;
}
}

// If there has been new chat, poll frequently
if (0 < chat_records.Count)
{
current_sleep_backoff_seconds = 1;
next_autopoll_datetime = DateTime.UtcNow.AddSeconds(current_sleep_backoff_seconds);
}
else
{
current_sleep_backoff_seconds = Math.Min(MAX_SLEEP_BACKOFF_SECONDS, 2 * current_sleep_backoff_seconds);
next_autopoll_datetime = DateTime.UtcNow.AddSeconds(current_sleep_backoff_seconds);
}

// Update GUI
Application.Current.Dispatcher.BeginInvoke(new Action(() =>
{
bool is_currently_at_scroll_bottom = ObjChatFlowDocumentScroll.VerticalOffset == ObjChatFlowDocumentScroll.ScrollableHeight;

foreach (ChatRecord chat_record in chat_records)
{
// Is this a different user chatting?
if (null == previous_chat_record || chat_record.Username != previous_chat_record.Username || null == previous_paragraph)
{
previous_paragraph = new Paragraph();
ObjChatFlowDocument.Blocks.Add(previous_paragraph);

previous_paragraph.TextAlignment = ToggleTextAlignment();

Run username_run = new Run(chat_record.Username);
username_run.ToolTip = String.Format("{0} ({1})", chat_record.Username, chat_record.Timestamp);
username_run.FontSize = 12;
username_run.FontStyle = FontStyles.Italic;
username_run.Foreground = ThemeColours.Background_Brush_Blue_VeryVeryDark;
username_run.Cursor = Cursors.Pen;
username_run.MouseDown += username_run_MouseDown;

previous_paragraph.Inlines.Add(username_run);
}

previous_paragraph.Inlines.Add(new LineBreak());
previous_paragraph.Inlines.Add(new Run(chat_record.Comment));

previous_chat_record = chat_record;
}

if (is_currently_at_scroll_bottom)
{
ObjChatFlowDocumentScroll.ScrollToEnd();
}
}
));
using (StreamReader sr = new StreamReader(ms))
{
List<ChatRecord> chat_records = new List<ChatRecord>();
{
string line;
ChatRecord last_chat_record = null;
while (null != (line = sr.ReadLine()))
{
string[] items = line.Split('\t');
{
last_chat_record = new ChatRecord();
last_chat_record.Timestamp = items[0];
last_chat_record.Forum = items[1];
last_chat_record.Username = items[2];
last_chat_record.Comment = items[3];
}
chat_records.Add(last_chat_record);
}

// Record the last epoch
if (null != last_chat_record)
{
last_epoch = last_chat_record.Timestamp;
}
}

// If there has been new chat, poll frequently
if (0 < chat_records.Count)
{
current_sleep_backoff_seconds = 1;
next_autopoll_datetime = DateTime.UtcNow.AddSeconds(current_sleep_backoff_seconds);
}
else
{
current_sleep_backoff_seconds = Math.Min(MAX_SLEEP_BACKOFF_SECONDS, 2 * current_sleep_backoff_seconds);
next_autopoll_datetime = DateTime.UtcNow.AddSeconds(current_sleep_backoff_seconds);
}

// Update GUI
Application.Current.Dispatcher.BeginInvoke(new Action(() =>
{
bool is_currently_at_scroll_bottom = ObjChatFlowDocumentScroll.VerticalOffset == ObjChatFlowDocumentScroll.ScrollableHeight;

foreach (ChatRecord chat_record in chat_records)
{
// Is this a different user chatting?
if (null == previous_chat_record || chat_record.Username != previous_chat_record.Username || null == previous_paragraph)
{
previous_paragraph = new Paragraph();
ObjChatFlowDocument.Blocks.Add(previous_paragraph);

previous_paragraph.TextAlignment = ToggleTextAlignment();

Run username_run = new Run(chat_record.Username);
username_run.ToolTip = String.Format("{0} ({1})", chat_record.Username, chat_record.Timestamp);
username_run.FontSize = 12;
username_run.FontStyle = FontStyles.Italic;
username_run.Foreground = ThemeColours.Background_Brush_Blue_VeryVeryDark;
username_run.Cursor = Cursors.Pen;
username_run.MouseDown += username_run_MouseDown;

previous_paragraph.Inlines.Add(username_run);
}

previous_paragraph.Inlines.Add(new LineBreak());
previous_paragraph.Inlines.Add(new Run(chat_record.Comment));

previous_chat_record = chat_record;
}

if (is_currently_at_scroll_bottom)
{
ObjChatFlowDocumentScroll.ScrollToEnd();
}
}
));
}
}

void username_run_MouseDown(object sender, MouseButtonEventArgs e)
Expand Down
17 changes: 9 additions & 8 deletions Qiqqa/Common/AssociatePDFWithVanillaReferenceWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,21 @@ void CmdWeb_Click(object sender, RoutedEventArgs e)

void CmdLocal_Click(object sender, RoutedEventArgs e)
{
System.Windows.Forms.OpenFileDialog dlg = new System.Windows.Forms.OpenFileDialog
using (System.Windows.Forms.OpenFileDialog dlg = new System.Windows.Forms.OpenFileDialog
{
CheckFileExists = true,
CheckPathExists = true,
Filter = "PDF Files|*.pdf",
Multiselect = false,
Title = "Select the PDF document you wish to associate with this Vanilla Reference."
};

if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
FeatureTrackingManager.Instance.UseFeature(Features.Library_AttachToVanilla_Local);
pdf_document.AssociatePDFWithVanillaReference(dlg.FileName);
}
})
{
if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
FeatureTrackingManager.Instance.UseFeature(Features.Library_AttachToVanilla_Local);
pdf_document.AssociatePDFWithVanillaReference(dlg.FileName);
}
}

this.Close();
}
Expand Down
12 changes: 7 additions & 5 deletions Qiqqa/Common/Configuration/WebsiteAccess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,13 @@ public static void OpenOffsiteUrl(string finalUrl)
/// </summary>
public static string DownloadFile(OurSiteFileKind fileType)
{
WebClient web_client = new WebClient();
web_client.Proxy = ConfigurationManager.Instance.Proxy;
string temp_file = TempFile.GenerateTempFilename("tmp");
web_client.DownloadFile(GetOurFileUrl(fileType), temp_file);
return temp_file;
using (WebClient web_client = new WebClient())
{
web_client.Proxy = ConfigurationManager.Instance.Proxy;
string temp_file = TempFile.GenerateTempFilename("tmp");
web_client.DownloadFile(GetOurFileUrl(fileType), temp_file);
return temp_file;
}
}

/// <summary>
Expand Down
7 changes: 7 additions & 0 deletions Qiqqa/Common/ReadOutLoud/ReadOutLoudManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ public class ReadOutLoudManager
{
public static ReadOutLoudManager Instance = new ReadOutLoudManager();

// TODO
//
// Warning CA1001 Implement IDisposable on 'ReadOutLoudManager' because it creates members
// of the following IDisposable types: 'SpeechSynthesizer'.
// If 'ReadOutLoudManager' has previously shipped, adding new members that implement IDisposable
// to this type is considered a breaking change to existing consumers.

object read_out_loud_lock = new object();
SpeechSynthesizer speech_synthesizer;
Prompt current_prompt;
Expand Down
7 changes: 7 additions & 0 deletions Qiqqa/Common/TagManagement/TagEditorControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ public partial class TagEditorControl : UserControl
internal Feature TagFeature_Add { get; set; }
internal Feature TagFeature_Remove { get; set; }

// TODO
//
// Warning CA1001 Implement IDisposable on 'TagEditorControl' because it creates members
// of the following IDisposable types: 'WeakDependencyPropertyChangeNotifier'.
// If 'TagEditorControl' has previously shipped, adding new members that implement IDisposable
// to this type is considered a breaking change to existing consumers.

WeakDependencyPropertyChangeNotifier wdpcn;

public TagEditorControl()
Expand Down
14 changes: 9 additions & 5 deletions Qiqqa/DocumentConversionStuff/DocumentConversion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,16 @@ public static bool Convert(string filename, string pdf_filename)

private static bool ConvertorDOC(string filename, string pdf_filename)
{
WordDocument word_document = new WordDocument(filename);
DocToPDFConverter converter = new DocToPDFConverter();
PdfDocument pdf_document = converter.ConvertToPDF(word_document);
using (WordDocument word_document = new WordDocument(filename))
{
using (DocToPDFConverter converter = new DocToPDFConverter())
{
PdfDocument pdf_document = converter.ConvertToPDF(word_document);

pdf_document.Save(pdf_filename);
pdf_document.Close(true);
pdf_document.Save(pdf_filename);
pdf_document.Close(true);
}
}
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ private void DoConvert(string[] filenames)
PDFDocument pdf_document = WebLibraryManager.Instance.Library_Guest.AddNewDocumentToLibrary_SYNCHRONOUS(pdf_filename, filename, filename, null, null, null, true, false);
PDFReadingControl pdf_reading_control = MainWindowServiceDispatcher.Instance.OpenDocument(pdf_document);
pdf_reading_control.EnableGuestMoveNotification();

}),
DispatcherPriority.Background);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,18 @@ public LibraryBundleCreationControl()

void CmdCreateBundle_Click(object sender, RoutedEventArgs e)
{
FolderBrowserDialog dialog = new FolderBrowserDialog();
dialog.Description = "Please select the folder into which the two Library Bundle files should be placed.";
DialogResult result = dialog.ShowDialog();
if (result == DialogResult.OK)
using (FolderBrowserDialog dialog = new FolderBrowserDialog())
{
CreateBundle(dialog.SelectedPath.ToString());
}
else
{
MessageBoxes.Warn("Your Library Bundle creation has been cancelled.");
dialog.Description = "Please select the folder into which the two Library Bundle files should be placed.";
DialogResult result = dialog.ShowDialog();
if (result == DialogResult.OK)
{
CreateBundle(dialog.SelectedPath.ToString());
}
else
{
MessageBoxes.Warn("Your Library Bundle creation has been cancelled.");
}
}
}

Expand Down
Loading

0 comments on commit a540e50

Please sign in to comment.