Index: Core/Common/src/Core.Common.Base/Observer.cs =================================================================== diff -u -r67284323e2785c651633d9c52049ba12a9c70e6a -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Core/Common/src/Core.Common.Base/Observer.cs (.../Observer.cs) (revision 67284323e2785c651633d9c52049ba12a9c70e6a) +++ Core/Common/src/Core.Common.Base/Observer.cs (.../Observer.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -64,12 +64,21 @@ public void Dispose() { - Observable = null; + Dispose(true); + GC.SuppressFinalize(this); } public void UpdateObserver() { updateObserverAction(); } + + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + Observable = null; + } + } } } \ No newline at end of file Index: Core/Common/src/Core.Common.Base/RecursiveObserver.cs =================================================================== diff -u -r9649e55312348f856051d40881b4e902b1a15a3b -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Core/Common/src/Core.Common.Base/RecursiveObserver.cs (.../RecursiveObserver.cs) (revision 9649e55312348f856051d40881b4e902b1a15a3b) +++ Core/Common/src/Core.Common.Base/RecursiveObserver.cs (.../RecursiveObserver.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -76,14 +76,23 @@ public void Dispose() { - Observable = null; + Dispose(true); + GC.SuppressFinalize(this); } public void UpdateObserver() { updateObserverAction(); } + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + Observable = null; + } + } + private void UpdateObservedObjects() { // Detach from the currently observed containers Index: Core/Common/src/Core.Common.Controls.TreeView/TreeViewControl.cs =================================================================== diff -u -rac96d7c315129af851634ed5a4a6800b59ede718 -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Core/Common/src/Core.Common.Controls.TreeView/TreeViewControl.cs (.../TreeViewControl.cs) (revision ac96d7c315129af851634ed5a4a6800b59ede718) +++ Core/Common/src/Core.Common.Controls.TreeView/TreeViewControl.cs (.../TreeViewControl.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -814,10 +814,19 @@ public void Dispose() { - var observable = treeNode.Tag as IObservable; - observable?.Detach(this); + Dispose(true); + GC.SuppressFinalize(this); } + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + var observable = treeNode.Tag as IObservable; + observable?.Detach(this); + } + } + public void UpdateObserver() { treeViewControl.UpdateNode(treeNode); Index: Core/Common/src/Core.Common.Gui/Forms/MainWindow/MainWindow.xaml.cs =================================================================== diff -u -r16559315c0a64fffd05827d249200c62e353231f -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Core/Common/src/Core.Common.Gui/Forms/MainWindow/MainWindow.xaml.cs (.../MainWindow.xaml.cs) (revision 16559315c0a64fffd05827d249200c62e353231f) +++ Core/Common/src/Core.Common.Gui/Forms/MainWindow/MainWindow.xaml.cs (.../MainWindow.xaml.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -250,9 +250,9 @@ } } - public void Dispose() + protected virtual void Dispose(bool disposing) { - if (IsWindowDisposed) + if (IsWindowDisposed || !disposing) { return; } @@ -280,6 +280,13 @@ SetGui(null); } + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + /// /// Initializes and shows the property grid tool window. /// Index: Core/Common/src/Core.Common.Gui/Forms/ViewHost/AvalonDockViewHost.xaml.cs =================================================================== diff -u -re3ebc9635d55057cb242e9a5b4f650b9c87737a8 -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Core/Common/src/Core.Common.Gui/Forms/ViewHost/AvalonDockViewHost.xaml.cs (.../AvalonDockViewHost.xaml.cs) (revision e3ebc9635d55057cb242e9a5b4f650b9c87737a8) +++ Core/Common/src/Core.Common.Gui/Forms/ViewHost/AvalonDockViewHost.xaml.cs (.../AvalonDockViewHost.xaml.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -125,8 +125,7 @@ }; var layoutDocument = new LayoutDocument { - Title = view.Text, - Content = hostControl + Title = view.Text, Content = hostControl }; PerformWithoutChangingActiveContent(() => AddLayoutDocument(layoutDocument)); @@ -162,8 +161,7 @@ }; var layoutAnchorable = new LayoutAnchorable { - Content = hostControl, - Title = view.Text + Content = hostControl, Title = view.Text }; PerformWithoutChangingActiveContent(() => AddLayoutAnchorable(layoutAnchorable, toolViewLocation)); @@ -232,6 +230,17 @@ public void Dispose() { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (!disposing) + { + return; + } + foreach (IView view in documentViews.Concat(toolViews).ToArray()) { Remove(view); @@ -420,7 +429,7 @@ LayoutAnchorablePaneGroup layoutAnchorablePaneGroup; if (!Enum.IsDefined(typeof(ToolViewLocation), toolViewLocation)) { - throw new InvalidEnumArgumentException(nameof(toolViewLocation), (int)toolViewLocation, typeof(ToolViewLocation)); + throw new InvalidEnumArgumentException(nameof(toolViewLocation), (int) toolViewLocation, typeof(ToolViewLocation)); } switch (toolViewLocation) @@ -431,6 +440,7 @@ LeftLayoutAnchorablePaneGroup.Children.Add(new LayoutAnchorablePane()); LeftRightLayoutTarget.Children.Insert(0, LeftLayoutAnchorablePaneGroup); } + layoutAnchorablePaneGroup = LeftLayoutAnchorablePaneGroup; break; case ToolViewLocation.Bottom: @@ -439,6 +449,7 @@ BottomLayoutAnchorablePaneGroup.Children.Add(new LayoutAnchorablePane()); BottomLayoutTarget.Children.Add(BottomLayoutAnchorablePaneGroup); } + layoutAnchorablePaneGroup = BottomLayoutAnchorablePaneGroup; break; case ToolViewLocation.Right: @@ -447,6 +458,7 @@ RightLayoutAnchorablePaneGroup.Children.Add(new LayoutAnchorablePane()); LeftRightLayoutTarget.Children.Add(RightLayoutAnchorablePaneGroup); } + layoutAnchorablePaneGroup = RightLayoutAnchorablePaneGroup; break; default: Index: Core/Common/src/Core.Common.Gui/Forms/ViewHost/DocumentViewController.cs =================================================================== diff -u -r7f997e6d093cb208c943e8e4b1bad52802cc551f -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Core/Common/src/Core.Common.Gui/Forms/ViewHost/DocumentViewController.cs (.../DocumentViewController.cs) (revision 7f997e6d093cb208c943e8e4b1bad52802cc551f) +++ Core/Common/src/Core.Common.Gui/Forms/ViewHost/DocumentViewController.cs (.../DocumentViewController.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -67,7 +67,8 @@ public void Dispose() { - viewHost.ViewClosed -= ViewHostOnViewClosed; + Dispose(true); + GC.SuppressFinalize(this); } public bool OpenViewForData(object data, bool alwaysShowDialog = false) @@ -132,6 +133,14 @@ return viewInfos.Where(vi => data.GetType().Implements(vi.DataType) && vi.AdditionalDataCheck(data)); } + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + viewHost.ViewClosed -= ViewHostOnViewClosed; + } + } + private static IEnumerable FilterOnInheritance(IEnumerable compatibleStandaloneViewInfos) { ViewInfo[] viewInfos = compatibleStandaloneViewInfos.ToArray(); @@ -250,8 +259,7 @@ Dictionary viewTypeDictionary = viewInfoList.ToDictionary(vi => vi.Description ?? vi.ViewType.Name); using (var viewSelector = new SelectViewDialog(dialogParent) { - DefaultViewName = defaultViewName, - Items = viewTypeDictionary.Keys.ToList() + DefaultViewName = defaultViewName, Items = viewTypeDictionary.Keys.ToList() }) { if (viewSelector.ShowDialog() != DialogResult.OK) Index: Core/Common/src/Core.Common.Gui/Plugin/PluginBase.cs =================================================================== diff -u -r67284323e2785c651633d9c52049ba12a9c70e6a -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Core/Common/src/Core.Common.Gui/Plugin/PluginBase.cs (.../PluginBase.cs) (revision 67284323e2785c651633d9c52049ba12a9c70e6a) +++ Core/Common/src/Core.Common.Gui/Plugin/PluginBase.cs (.../PluginBase.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -117,9 +117,18 @@ yield break; } - public virtual void Dispose() + public void Dispose() { - Gui = null; + Dispose(true); + GC.SuppressFinalize(this); } + + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + Gui = null; + } + } } } \ No newline at end of file Index: Core/Common/src/Core.Common.Util/IO/EmbeddedResourceFileWriter.cs =================================================================== diff -u -rac96d7c315129af851634ed5a4a6800b59ede718 -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Core/Common/src/Core.Common.Util/IO/EmbeddedResourceFileWriter.cs (.../EmbeddedResourceFileWriter.cs) (revision ac96d7c315129af851634ed5a4a6800b59ede718) +++ Core/Common/src/Core.Common.Util/IO/EmbeddedResourceFileWriter.cs (.../EmbeddedResourceFileWriter.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -51,6 +51,7 @@ { throw new ArgumentNullException(nameof(assembly)); } + if (embeddedResourceFileNames == null) { throw new ArgumentNullException(nameof(embeddedResourceFileNames)); @@ -73,12 +74,18 @@ /// public string TargetFolderPath { get; } + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + /// /// Disposes the instance. /// - public void Dispose() + protected virtual void Dispose(bool disposing) { - if (removeFilesOnDispose) + if (removeFilesOnDispose && disposing) { Directory.Delete(TargetFolderPath, true); } Index: Core/Components/src/Core.Components.BruTile/FileCacheManager.cs =================================================================== diff -u -r0aeb68adb50c0f4d97c91bdffd1ecc502a1946f5 -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Core/Components/src/Core.Components.BruTile/FileCacheManager.cs (.../FileCacheManager.cs) (revision 0aeb68adb50c0f4d97c91bdffd1ecc502a1946f5) +++ Core/Components/src/Core.Components.BruTile/FileCacheManager.cs (.../FileCacheManager.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -153,8 +153,17 @@ public void Dispose() { - FileCache = null; + Dispose(true); + GC.SuppressFinalize(this); } + + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + FileCache = null; + } + } } } } \ No newline at end of file Index: Core/Components/src/Core.Components.DotSpatial/RdNewMouseCoordinatesMapExtension.cs =================================================================== diff -u -r2c5e077a0f546af6d6379eb93111fd8366fc2224 -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Core/Components/src/Core.Components.DotSpatial/RdNewMouseCoordinatesMapExtension.cs (.../RdNewMouseCoordinatesMapExtension.cs) (revision 2c5e077a0f546af6d6379eb93111fd8366fc2224) +++ Core/Components/src/Core.Components.DotSpatial/RdNewMouseCoordinatesMapExtension.cs (.../RdNewMouseCoordinatesMapExtension.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -50,19 +50,17 @@ { throw new ArgumentNullException(nameof(map), @"An extension cannot be initialized without map."); } + this.map = map; xLabel = new Label { - AutoSize = true, - BorderStyle = BorderStyle.None, - Margin = new Padding(0, 0, 10, 0) + AutoSize = true, BorderStyle = BorderStyle.None, Margin = new Padding(0, 0, 10, 0) }; yLabel = new Label { - AutoSize = true, - BorderStyle = BorderStyle.None + AutoSize = true, BorderStyle = BorderStyle.None }; panel = new TableLayoutPanel @@ -72,8 +70,7 @@ Height = 16, Controls = { - xLabel, - yLabel + xLabel, yLabel }, RowCount = 1, ColumnCount = 2 @@ -103,19 +100,28 @@ public void Dispose() { - xLabel.Dispose(); - yLabel.Dispose(); - panel.Dispose(); + Dispose(true); + GC.SuppressFinalize(this); } + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + xLabel.Dispose(); + yLabel.Dispose(); + panel.Dispose(); + } + } + private void OnMouseMove(object sender, GeoMouseArgs e) { double x = e.GeographicLocation.X; double y = e.GeographicLocation.Y; if (!targetProjection.Equals(map.Projection)) { - var xy = new[] + double[] xy = { x, y @@ -127,6 +133,7 @@ x = xy[0]; y = xy[1]; } + xLabel.Text = $@"X: {x:0.#####}"; yLabel.Text = $@"Y: {y:0.#####}"; } Index: Core/Components/src/Core.Components.Gis.IO/Readers/ShapeFileReaderBase.cs =================================================================== diff -u -ra8744fa1e115c1317d15a3f5784474aacaf2227d -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Core/Components/src/Core.Components.Gis.IO/Readers/ShapeFileReaderBase.cs (.../ShapeFileReaderBase.cs) (revision a8744fa1e115c1317d15a3f5784474aacaf2227d) +++ Core/Components/src/Core.Components.Gis.IO/Readers/ShapeFileReaderBase.cs (.../ShapeFileReaderBase.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -104,14 +104,23 @@ public void Dispose() { - ShapeFile?.Close(); + Dispose(true); + GC.SuppressFinalize(this); } /// /// Gets the path to the shapefile. /// protected string FilePath { get; } + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + ShapeFile?.Close(); + } + } + /// /// Adds shapefile feature attributes to a as metadata. /// Index: Core/Components/src/Core.Components.Gis.IO/Writers/ShapeFileWriterBase.cs =================================================================== diff -u -rb9e640cceb967cc24e3999c373ddb5040e59a1f0 -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Core/Components/src/Core.Components.Gis.IO/Writers/ShapeFileWriterBase.cs (.../ShapeFileWriterBase.cs) (revision b9e640cceb967cc24e3999c373ddb5040e59a1f0) +++ Core/Components/src/Core.Components.Gis.IO/Writers/ShapeFileWriterBase.cs (.../ShapeFileWriterBase.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -93,9 +93,18 @@ public void Dispose() { - ShapeFile?.Close(); + Dispose(true); + GC.SuppressFinalize(this); } + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + ShapeFile?.Close(); + } + } + /// /// Create a new feature from a . /// @@ -147,8 +156,7 @@ object value = metaData[key]; columns.Add(new DataColumn { - DataType = value.GetType(), - ColumnName = key + DataType = value.GetType(), ColumnName = key }); } } Index: Core/Plugins/src/Core.Plugins.Chart/ChartPlugin.cs =================================================================== diff -u -ra999c7ca7999cc5e15b938120496d19364b26cc8 -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Core/Plugins/src/Core.Plugins.Chart/ChartPlugin.cs (.../ChartPlugin.cs) (revision a999c7ca7999cc5e15b938120496d19364b26cc8) +++ Core/Plugins/src/Core.Plugins.Chart/ChartPlugin.cs (.../ChartPlugin.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -74,17 +74,17 @@ yield return new PropertyInfo(); } - public override void Dispose() + protected override void Dispose(bool disposing) { - if (activated) + if (activated && disposing) { Gui.ViewHost.ViewOpened -= OnViewOpened; Gui.ViewHost.ViewBroughtToFront -= OnViewBroughtToFront; Gui.ViewHost.ViewClosed -= OnViewClosed; Gui.ViewHost.ActiveDocumentViewChanged -= OnActiveDocumentViewChanged; } - base.Dispose(); + base.Dispose(disposing); } /// Index: Core/Plugins/src/Core.Plugins.Map/Legend/MapLegendController.cs =================================================================== diff -u -r67284323e2785c651633d9c52049ba12a9c70e6a -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Core/Plugins/src/Core.Plugins.Map/Legend/MapLegendController.cs (.../MapLegendController.cs) (revision 67284323e2785c651633d9c52049ba12a9c70e6a) +++ Core/Plugins/src/Core.Plugins.Map/Legend/MapLegendController.cs (.../MapLegendController.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -58,11 +58,13 @@ throw new ArgumentNullException(nameof(viewController), $@"Cannot create a {typeof(MapLegendController).Name} when the view controller is null."); } + if (contextMenuBuilderProvider == null) { throw new ArgumentNullException(nameof(contextMenuBuilderProvider), $@"Cannot create a {typeof(MapLegendController).Name} when the context menu builder provider is null."); } + this.viewController = viewController; this.contextMenuBuilderProvider = contextMenuBuilderProvider; } @@ -109,9 +111,18 @@ public void Dispose() { - CloseLegendView(); + Dispose(true); + GC.SuppressFinalize(this); } + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + CloseLegendView(); + } + } + /// /// Opens the . /// Index: Core/Plugins/src/Core.Plugins.Map/MapPlugin.cs =================================================================== diff -u -rac96d7c315129af851634ed5a4a6800b59ede718 -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Core/Plugins/src/Core.Plugins.Map/MapPlugin.cs (.../MapPlugin.cs) (revision ac96d7c315129af851634ed5a4a6800b59ede718) +++ Core/Plugins/src/Core.Plugins.Map/MapPlugin.cs (.../MapPlugin.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -90,18 +90,22 @@ }; } - public override void Dispose() + protected override void Dispose(bool disposing) { - if (activated) + if (disposing) { - Gui.ViewHost.ViewOpened -= OnViewOpened; - Gui.ViewHost.ViewBroughtToFront -= OnViewBroughtToFront; - Gui.ViewHost.ViewClosed -= OnViewClosed; - Gui.ViewHost.ActiveDocumentViewChanged -= OnActiveDocumentViewChanged; + if (activated) + { + Gui.ViewHost.ViewOpened -= OnViewOpened; + Gui.ViewHost.ViewBroughtToFront -= OnViewBroughtToFront; + Gui.ViewHost.ViewClosed -= OnViewClosed; + Gui.ViewHost.ActiveDocumentViewChanged -= OnActiveDocumentViewChanged; + } + + mapLegendController?.Dispose(); } - mapLegendController?.Dispose(); - base.Dispose(); + base.Dispose(disposing); } private MapLegendController CreateLegendController(IViewController viewController) Index: Core/Plugins/src/Core.Plugins.ProjectExplorer/ProjectExplorerPlugin.cs =================================================================== diff -u -r67284323e2785c651633d9c52049ba12a9c70e6a -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Core/Plugins/src/Core.Plugins.ProjectExplorer/ProjectExplorerPlugin.cs (.../ProjectExplorerPlugin.cs) (revision 67284323e2785c651633d9c52049ba12a9c70e6a) +++ Core/Plugins/src/Core.Plugins.ProjectExplorer/ProjectExplorerPlugin.cs (.../ProjectExplorerPlugin.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -121,13 +121,6 @@ active = true; } - public override void Dispose() - { - Deactivate(); - - base.Dispose(); - } - public override void Deactivate() { base.Deactivate(); @@ -140,6 +133,16 @@ } } + protected override void Dispose(bool disposing) + { + if (disposing) + { + Deactivate(); + } + + base.Dispose(disposing); + } + private void ApplicationProjectOpened(IProject project) { UpdateProject(); Index: Core/Plugins/src/Core.Plugins.ProjectExplorer/ProjectExplorerViewController.cs =================================================================== diff -u -r67284323e2785c651633d9c52049ba12a9c70e6a -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Core/Plugins/src/Core.Plugins.ProjectExplorer/ProjectExplorerViewController.cs (.../ProjectExplorerViewController.cs) (revision 67284323e2785c651633d9c52049ba12a9c70e6a) +++ Core/Plugins/src/Core.Plugins.ProjectExplorer/ProjectExplorerViewController.cs (.../ProjectExplorerViewController.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -67,10 +67,12 @@ { throw new ArgumentNullException(nameof(viewCommands)); } + if (viewController == null) { throw new ArgumentNullException(nameof(viewController)); } + if (treeNodeInfos == null) { throw new ArgumentNullException(nameof(treeNodeInfos)); @@ -121,12 +123,19 @@ public void Dispose() { - if (projectExplorer != null) + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (projectExplorer != null && disposing) { if (IsProjectExplorerOpen) { CloseProjectExplorer(); } + projectExplorer.Dispose(); } } Index: Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil/Calculators/AssemblyToolCalculatorFactoryConfig.cs =================================================================== diff -u -rc0a1601c561a4f873da7c639326077d5f4733854 -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil/Calculators/AssemblyToolCalculatorFactoryConfig.cs (.../AssemblyToolCalculatorFactoryConfig.cs) (revision c0a1601c561a4f873da7c639326077d5f4733854) +++ Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil/Calculators/AssemblyToolCalculatorFactoryConfig.cs (.../AssemblyToolCalculatorFactoryConfig.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -55,13 +55,22 @@ AssemblyToolCalculatorFactory.Instance = new TestAssemblyToolCalculatorFactory(); } + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + /// /// Reverts the to the value /// it had at time of construction of the . /// - public void Dispose() + protected virtual void Dispose(bool disposing) { - AssemblyToolCalculatorFactory.Instance = previousFactory; + if (disposing) + { + AssemblyToolCalculatorFactory.Instance = previousFactory; + } } } } \ No newline at end of file Index: Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil/Kernels/AssemblyToolKernelFactoryConfig.cs =================================================================== diff -u -raf2dccd51c7d3ece1434603ea37e8f75cdbb54a2 -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil/Kernels/AssemblyToolKernelFactoryConfig.cs (.../AssemblyToolKernelFactoryConfig.cs) (revision af2dccd51c7d3ece1434603ea37e8f75cdbb54a2) +++ Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil/Kernels/AssemblyToolKernelFactoryConfig.cs (.../AssemblyToolKernelFactoryConfig.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -55,13 +55,22 @@ AssemblyToolKernelFactory.Instance = new TestAssemblyToolKernelFactory(); } + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + /// /// Reverts the to the value /// it had at time of construction of the . /// - public void Dispose() + protected virtual void Dispose(bool disposing) { - AssemblyToolKernelFactory.Instance = previousFactory; + if (disposing) + { + AssemblyToolKernelFactory.Instance = previousFactory; + } } } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Helpers/SuspendDataGridViewColumnResizes.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Ringtoets/Common/src/Ringtoets.Common.Forms/Helpers/SuspendDataGridViewColumnResizes.cs (.../SuspendDataGridViewColumnResizes.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Helpers/SuspendDataGridViewColumnResizes.cs (.../SuspendDataGridViewColumnResizes.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -51,7 +51,16 @@ public void Dispose() { - column.AutoSizeMode = originalValue; + Dispose(true); + GC.SuppressFinalize(this); } + + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + column.AutoSizeMode = originalValue; + } + } } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/FailureMechanismSectionsProbabilityAssessmentProperties.cs =================================================================== diff -u -r9c62dbc3f18cb81172af025c25ef3cc7b5578035 -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/FailureMechanismSectionsProbabilityAssessmentProperties.cs (.../FailureMechanismSectionsProbabilityAssessmentProperties.cs) (revision 9c62dbc3f18cb81172af025c25ef3cc7b5578035) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/FailureMechanismSectionsProbabilityAssessmentProperties.cs (.../FailureMechanismSectionsProbabilityAssessmentProperties.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -98,7 +98,16 @@ public void Dispose() { - failureMechanismObserver.Dispose(); + Dispose(true); + GC.SuppressFinalize(this); } + + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + failureMechanismObserver.Dispose(); + } + } } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/FailureMechanismSectionsProperties.cs =================================================================== diff -u -r9c62dbc3f18cb81172af025c25ef3cc7b5578035 -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/FailureMechanismSectionsProperties.cs (.../FailureMechanismSectionsProperties.cs) (revision 9c62dbc3f18cb81172af025c25ef3cc7b5578035) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/FailureMechanismSectionsProperties.cs (.../FailureMechanismSectionsProperties.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -87,7 +87,16 @@ public void Dispose() { - failureMechanismObserver.Dispose(); + Dispose(true); + GC.SuppressFinalize(this); } + + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + failureMechanismObserver.Dispose(); + } + } } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/HydraulicBoundaryLocationCalculationsGroupBaseProperties.cs =================================================================== diff -u -r56626c752d7c8566140a16869e5525b6924e8add -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/HydraulicBoundaryLocationCalculationsGroupBaseProperties.cs (.../HydraulicBoundaryLocationCalculationsGroupBaseProperties.cs) (revision 56626c752d7c8566140a16869e5525b6924e8add) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/HydraulicBoundaryLocationCalculationsGroupBaseProperties.cs (.../HydraulicBoundaryLocationCalculationsGroupBaseProperties.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -74,9 +74,18 @@ public void Dispose() { - hydraulicBoundaryLocationCalculationsObserver.Dispose(); + Dispose(true); + GC.SuppressFinalize(this); } + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + hydraulicBoundaryLocationCalculationsObserver.Dispose(); + } + } + /// /// Gets a collection of with the category boundary name and /// calculations that belong to . Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/HydraulicBoundaryLocationCalculationsProperties.cs =================================================================== diff -u -rf937806272bc4ed4d04ab0de94937057649b9fe6 -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/HydraulicBoundaryLocationCalculationsProperties.cs (.../HydraulicBoundaryLocationCalculationsProperties.cs) (revision f937806272bc4ed4d04ab0de94937057649b9fe6) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/HydraulicBoundaryLocationCalculationsProperties.cs (.../HydraulicBoundaryLocationCalculationsProperties.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -55,7 +55,16 @@ public void Dispose() { - hydraulicBoundaryLocationCalculationsObserver.Dispose(); + Dispose(true); + GC.SuppressFinalize(this); } + + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + hydraulicBoundaryLocationCalculationsObserver.Dispose(); + } + } } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.IO/DikeProfiles/ProfileLocationReader.cs =================================================================== diff -u -rb9e640cceb967cc24e3999c373ddb5040e59a1f0 -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Ringtoets/Common/src/Ringtoets.Common.IO/DikeProfiles/ProfileLocationReader.cs (.../ProfileLocationReader.cs) (revision b9e640cceb967cc24e3999c373ddb5040e59a1f0) +++ Ringtoets/Common/src/Ringtoets.Common.IO/DikeProfiles/ProfileLocationReader.cs (.../ProfileLocationReader.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -113,9 +113,18 @@ public void Dispose() { - pointsShapeFileReader.Dispose(); + Dispose(true); + GC.SuppressFinalize(this); } + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + pointsShapeFileReader.Dispose(); + } + } + /// /// Open a shapefile containing dike locations as point features. /// Index: Ringtoets/Common/src/Ringtoets.Common.IO/FailureMechanismSectionReader.cs =================================================================== diff -u -r9f16958e6f9a88135b64b88be8880d55facd1937 -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Ringtoets/Common/src/Ringtoets.Common.IO/FailureMechanismSectionReader.cs (.../FailureMechanismSectionReader.cs) (revision 9f16958e6f9a88135b64b88be8880d55facd1937) +++ Ringtoets/Common/src/Ringtoets.Common.IO/FailureMechanismSectionReader.cs (.../FailureMechanismSectionReader.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -96,9 +96,18 @@ public void Dispose() { - polylineShapeFileReader.Dispose(); + Dispose(true); + GC.SuppressFinalize(this); } + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + polylineShapeFileReader.Dispose(); + } + } + /// /// Validates the existence of required attributes. /// Index: Ringtoets/Common/src/Ringtoets.Common.IO/HydraRing/DesignTablesSettingsProvider.cs =================================================================== diff -u -rf8c28b3b04cdabb62ea37772efcb1f4ebbbf2b9e -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Ringtoets/Common/src/Ringtoets.Common.IO/HydraRing/DesignTablesSettingsProvider.cs (.../DesignTablesSettingsProvider.cs) (revision f8c28b3b04cdabb62ea37772efcb1f4ebbbf2b9e) +++ Ringtoets/Common/src/Ringtoets.Common.IO/HydraRing/DesignTablesSettingsProvider.cs (.../DesignTablesSettingsProvider.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -74,60 +74,57 @@ public void Dispose() { - designTablesSettingsReader.Dispose(); + Dispose(true); + GC.SuppressFinalize(this); } + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + designTablesSettingsReader.Dispose(); + } + } + private void InitializeDefaultDesignTablesSettings() { defaultDesignTablesSettings = new Dictionary { { - HydraRingFailureMechanismType.AssessmentLevel, - new DesignTablesSetting(2, 4) + HydraRingFailureMechanismType.AssessmentLevel, new DesignTablesSetting(2, 4) }, { - HydraRingFailureMechanismType.WaveHeight, - new DesignTablesSetting(1, 4) + HydraRingFailureMechanismType.WaveHeight, new DesignTablesSetting(1, 4) }, { - HydraRingFailureMechanismType.WavePeakPeriod, - new DesignTablesSetting(5, 15) + HydraRingFailureMechanismType.WavePeakPeriod, new DesignTablesSetting(5, 15) }, { - HydraRingFailureMechanismType.WaveSpectralPeriod, - new DesignTablesSetting(5, 15) + HydraRingFailureMechanismType.WaveSpectralPeriod, new DesignTablesSetting(5, 15) }, { - HydraRingFailureMechanismType.QVariant, - new DesignTablesSetting(10, 50) + HydraRingFailureMechanismType.QVariant, new DesignTablesSetting(10, 50) }, { - HydraRingFailureMechanismType.DikeHeight, - new DesignTablesSetting(2, 4) + HydraRingFailureMechanismType.DikeHeight, new DesignTablesSetting(2, 4) }, { - HydraRingFailureMechanismType.DikesOvertopping, - new DesignTablesSetting(double.NaN, double.NaN) + HydraRingFailureMechanismType.DikesOvertopping, new DesignTablesSetting(double.NaN, double.NaN) }, { - HydraRingFailureMechanismType.StructuresOvertopping, - new DesignTablesSetting(double.NaN, double.NaN) + HydraRingFailureMechanismType.StructuresOvertopping, new DesignTablesSetting(double.NaN, double.NaN) }, { - HydraRingFailureMechanismType.StructuresClosure, - new DesignTablesSetting(double.NaN, double.NaN) + HydraRingFailureMechanismType.StructuresClosure, new DesignTablesSetting(double.NaN, double.NaN) }, { - HydraRingFailureMechanismType.StructuresStructuralFailure, - new DesignTablesSetting(double.NaN, double.NaN) + HydraRingFailureMechanismType.StructuresStructuralFailure, new DesignTablesSetting(double.NaN, double.NaN) }, { - HydraRingFailureMechanismType.DunesBoundaryConditions, - new DesignTablesSetting(3.5, 6) + HydraRingFailureMechanismType.DunesBoundaryConditions, new DesignTablesSetting(3.5, 6) }, { - HydraRingFailureMechanismType.OvertoppingRate, - new DesignTablesSetting(0.001, 0.01) + HydraRingFailureMechanismType.OvertoppingRate, new DesignTablesSetting(0.001, 0.01) } }; } Index: Ringtoets/Common/src/Ringtoets.Common.IO/HydraRing/NumericsSettingsProvider.cs =================================================================== diff -u -r09c47b676fdd8a2a9f891f226e1c2a676a3dec08 -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Ringtoets/Common/src/Ringtoets.Common.IO/HydraRing/NumericsSettingsProvider.cs (.../NumericsSettingsProvider.cs) (revision 09c47b676fdd8a2a9f891f226e1c2a676a3dec08) +++ Ringtoets/Common/src/Ringtoets.Common.IO/HydraRing/NumericsSettingsProvider.cs (.../NumericsSettingsProvider.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -107,9 +107,18 @@ public void Dispose() { - numericsSettingsReader.Dispose(); + Dispose(true); + GC.SuppressFinalize(this); } + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + numericsSettingsReader.Dispose(); + } + } + private void InitializeDefaultNumericsSettings() { NumericsSetting numericsSettingForm = CreateDefaultNumericsSetting(1, 1); // Settings for a FORM calculation Index: Ringtoets/Common/src/Ringtoets.Common.IO/HydraRing/PreprocessorSettingsProvider.cs =================================================================== diff -u -r89a363d53d9b2a3579006afdaab1a6c37bdd0747 -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Ringtoets/Common/src/Ringtoets.Common.IO/HydraRing/PreprocessorSettingsProvider.cs (.../PreprocessorSettingsProvider.cs) (revision 89a363d53d9b2a3579006afdaab1a6c37bdd0747) +++ Ringtoets/Common/src/Ringtoets.Common.IO/HydraRing/PreprocessorSettingsProvider.cs (.../PreprocessorSettingsProvider.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -79,9 +79,18 @@ public void Dispose() { - preprocessorSettingsReader.Dispose(); + Dispose(true); + GC.SuppressFinalize(this); } + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + preprocessorSettingsReader.Dispose(); + } + } + /// /// Checks whether the location corresponding to the provided id is an excluded location. /// Index: Ringtoets/Common/src/Ringtoets.Common.IO/HydraRing/TimeIntegrationSettingsProvider.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Ringtoets/Common/src/Ringtoets.Common.IO/HydraRing/TimeIntegrationSettingsProvider.cs (.../TimeIntegrationSettingsProvider.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/src/Ringtoets.Common.IO/HydraRing/TimeIntegrationSettingsProvider.cs (.../TimeIntegrationSettingsProvider.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -70,7 +70,16 @@ public void Dispose() { - timeIntegrationSettingsReader.Dispose(); + Dispose(true); + GC.SuppressFinalize(this); } + + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + timeIntegrationSettingsReader.Dispose(); + } + } } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.IO/Structures/StructureLocationReader.cs =================================================================== diff -u -rb9e640cceb967cc24e3999c373ddb5040e59a1f0 -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Ringtoets/Common/src/Ringtoets.Common.IO/Structures/StructureLocationReader.cs (.../StructureLocationReader.cs) (revision b9e640cceb967cc24e3999c373ddb5040e59a1f0) +++ Ringtoets/Common/src/Ringtoets.Common.IO/Structures/StructureLocationReader.cs (.../StructureLocationReader.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -103,14 +103,24 @@ { throw new LineParseException(string.Format(Resources.StructuresReader_GetNextStructure_Invalid_KWKIDENT, idAttributeName)); } + return new StructureLocation(attributeIdValue, attributeNameValue, point); } public void Dispose() { - pointsShapeFileReader.Dispose(); + Dispose(true); + GC.SuppressFinalize(this); } + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + pointsShapeFileReader.Dispose(); + } + } + private static string GetIdAttributeValue(IDictionary attributes) { var attributeIdValue = attributes[idAttributeName] as string; @@ -123,6 +133,7 @@ { return defaultName; } + var attributeNameValue = attributes[nameAttributeName] as string; return string.IsNullOrWhiteSpace(attributeNameValue) ? defaultName : attributeNameValue; } Index: Ringtoets/Common/src/Ringtoets.Common.IO/Structures/StructuresCharacteristicsCsvReader.cs =================================================================== diff -u -rb9e640cceb967cc24e3999c373ddb5040e59a1f0 -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Ringtoets/Common/src/Ringtoets.Common.IO/Structures/StructuresCharacteristicsCsvReader.cs (.../StructuresCharacteristicsCsvReader.cs) (revision b9e640cceb967cc24e3999c373ddb5040e59a1f0) +++ Ringtoets/Common/src/Ringtoets.Common.IO/Structures/StructuresCharacteristicsCsvReader.cs (.../StructuresCharacteristicsCsvReader.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -140,7 +140,13 @@ public void Dispose() { - if (fileReader != null) + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (fileReader != null && disposing) { fileReader.Dispose(); fileReader = null; @@ -178,8 +184,10 @@ { count++; } + lineNumberForMessage++; } + return count; } @@ -270,6 +278,7 @@ } } } + return requiredHeaderColumnIndices; } @@ -319,6 +328,7 @@ break; } } + return readText; } @@ -380,6 +390,7 @@ separator); throw CreateLineParseException(lineNumber, message); } + return readText.Split(separator) .ToArray(); } @@ -418,6 +429,7 @@ parameterName); throw CreateLineParseException(lineNumber, message); } + return parameterTextValue; } @@ -468,6 +480,7 @@ { return double.NaN; } + try { return double.Parse(doubleValueText, CultureInfo.InvariantCulture); @@ -497,17 +510,20 @@ { return VarianceType.NotSpecified; } + try { int typeValue = int.Parse(varianceTypeText, CultureInfo.InvariantCulture); if (typeValue == 0) { return VarianceType.CoefficientOfVariation; } + if (typeValue == 1) { return VarianceType.StandardDeviation; } + throw CreateLineParseException(lineNumber, string.Format(Resources.StructuresCharacteristicsCsvReader_ParseVarianceType_ParameterName_0_only_allows_certain_values, StructureFilesKeywords.VariationTypeColumnName.FirstToUpper())); Index: Ringtoets/Common/src/Ringtoets.Common.IO/SurfaceLines/CharacteristicPointsCsvReader.cs =================================================================== diff -u -rb9e640cceb967cc24e3999c373ddb5040e59a1f0 -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Ringtoets/Common/src/Ringtoets.Common.IO/SurfaceLines/CharacteristicPointsCsvReader.cs (.../CharacteristicPointsCsvReader.cs) (revision b9e640cceb967cc24e3999c373ddb5040e59a1f0) +++ Ringtoets/Common/src/Ringtoets.Common.IO/SurfaceLines/CharacteristicPointsCsvReader.cs (.../CharacteristicPointsCsvReader.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -154,12 +154,15 @@ return null; } - /// - /// Disposes the current . - /// public void Dispose() { - if (fileReader != null) + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (fileReader != null && disposing) { fileReader.Dispose(); fileReader = null; @@ -185,6 +188,7 @@ break; } } + return readText; } @@ -305,6 +309,7 @@ { locationIdColumnIndex = Array.IndexOf(tokenizedHeader, surfaceLineKey); } + if (locationIdColumnIndex > -1) { columnsInFile[locationIdKey] = locationIdColumnIndex; @@ -313,6 +318,7 @@ { return false; } + return true; } @@ -334,8 +340,10 @@ { count++; } + lineNumberForMessage++; } + return count; } @@ -357,6 +365,7 @@ { throw CreateLineParseException(lineNumber, locationName, Resources.CharacteristicPointsCsvReader_ReadCharacteristicPointsLocation_Location_lacks_values_for_characteristic_points); } + var location = new CharacteristicPoints(locationName); SetCharacteristicPoints(tokenizedString, location); @@ -428,6 +437,7 @@ point = null; } } + return point; } catch (FormatException e) @@ -454,6 +464,7 @@ { throw CreateLineParseException(lineNumber, Resources.CharacteristicPointsCsvReader_ReadLine_Line_lacks_ID); } + return name; } @@ -470,6 +481,7 @@ throw CreateLineParseException(lineNumber, string.Format(Resources.CharacteristicPointsCsvReader_ReadCharacteristicPointsLocation_Line_lacks_separator_0_, separator)); } + return readText.Split(separator) .TakeWhile(text => !string.IsNullOrEmpty(text)) .ToArray(); Index: Ringtoets/Common/src/Ringtoets.Common.IO/SurfaceLines/SurfaceLinesCsvReader.cs =================================================================== diff -u -rb9e640cceb967cc24e3999c373ddb5040e59a1f0 -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Ringtoets/Common/src/Ringtoets.Common.IO/SurfaceLines/SurfaceLinesCsvReader.cs (.../SurfaceLinesCsvReader.cs) (revision b9e640cceb967cc24e3999c373ddb5040e59a1f0) +++ Ringtoets/Common/src/Ringtoets.Common.IO/SurfaceLines/SurfaceLinesCsvReader.cs (.../SurfaceLinesCsvReader.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -158,7 +158,13 @@ public void Dispose() { - if (fileReader != null) + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (fileReader != null && disposing) { fileReader.Dispose(); fileReader = null; @@ -184,6 +190,7 @@ break; } } + return readText; } @@ -223,6 +230,7 @@ throw CreateLineParseException(lineNumber, string.Format(Resources.SurfaceLinesCsvReader_ReadLine_Line_lacks_separator_0_, separator)); } + return readText.Split(separator) .TakeWhile(text => !string.IsNullOrEmpty(text)) .ToArray(); @@ -260,6 +268,7 @@ double z = worldCoordinateValues[i * expectedValuesForPoint + 2]; points[i] = new Point3D(x, y, z); } + return points; } @@ -276,6 +285,7 @@ { throw CreateLineParseException(lineNumber, Resources.SurfaceLinesCsvReader_ReadLine_Line_lacks_ID); } + return name; } @@ -396,8 +406,10 @@ { count++; } + lineNumberForMessage++; } + return count; } @@ -450,6 +462,7 @@ { valid = tokenizedHeader[startGeometryColumnIndex + i].Equals(expectedFirstCoordinateHeader[i]); } + return valid; } Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/PropertyClasses/DuneLocationCalculationsProperties.cs =================================================================== diff -u -rf937806272bc4ed4d04ab0de94937057649b9fe6 -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/PropertyClasses/DuneLocationCalculationsProperties.cs (.../DuneLocationCalculationsProperties.cs) (revision f937806272bc4ed4d04ab0de94937057649b9fe6) +++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/PropertyClasses/DuneLocationCalculationsProperties.cs (.../DuneLocationCalculationsProperties.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -72,7 +72,16 @@ public void Dispose() { - calculationsObserver.Dispose(); + Dispose(true); + GC.SuppressFinalize(this); } + + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + calculationsObserver.Dispose(); + } + } } } \ No newline at end of file Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.TestUtil/Calculator/HydraRingCalculatorFactoryConfig.cs =================================================================== diff -u -rb7ce4e17d62bcc006615bb14f4f91030831cdb79 -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.TestUtil/Calculator/HydraRingCalculatorFactoryConfig.cs (.../HydraRingCalculatorFactoryConfig.cs) (revision b7ce4e17d62bcc006615bb14f4f91030831cdb79) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.TestUtil/Calculator/HydraRingCalculatorFactoryConfig.cs (.../HydraRingCalculatorFactoryConfig.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -62,17 +62,27 @@ { throw new ArgumentNullException(nameof(newFactory)); } + previousFactory = HydraRingCalculatorFactory.Instance; HydraRingCalculatorFactory.Instance = newFactory; } + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + /// /// Reverts the to the value /// it had at time of construction of the . /// - public void Dispose() + protected virtual void Dispose(bool disposing) { - HydraRingCalculatorFactory.Instance = previousFactory; + if (disposing) + { + HydraRingCalculatorFactory.Instance = previousFactory; + } } } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Observers/AssessmentSectionResultObserver.cs =================================================================== diff -u -r249431accea64484e3e0952271f03c2726acf426 -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Observers/AssessmentSectionResultObserver.cs (.../AssessmentSectionResultObserver.cs) (revision 249431accea64484e3e0952271f03c2726acf426) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Observers/AssessmentSectionResultObserver.cs (.../AssessmentSectionResultObserver.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -145,6 +145,17 @@ public void Dispose() { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (!disposing) + { + return; + } + assessmentSectionObserver.Dispose(); closingStructuresObserver.Dispose(); duneErosionObserver.Dispose(); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Calculators/MacroStabilityInwardsCalculatorFactoryConfig.cs =================================================================== diff -u -rbcb7ee1318355c19145c87d641d31c97307d59dd -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Calculators/MacroStabilityInwardsCalculatorFactoryConfig.cs (.../MacroStabilityInwardsCalculatorFactoryConfig.cs) (revision bcb7ee1318355c19145c87d641d31c97307d59dd) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Calculators/MacroStabilityInwardsCalculatorFactoryConfig.cs (.../MacroStabilityInwardsCalculatorFactoryConfig.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -55,13 +55,22 @@ MacroStabilityInwardsCalculatorFactory.Instance = new TestMacroStabilityInwardsCalculatorFactory(); } + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + /// /// Reverts the to the value /// it had at time of construction of the . /// - public void Dispose() + protected virtual void Dispose(bool disposing) { - MacroStabilityInwardsCalculatorFactory.Instance = previousFactory; + if (disposing) + { + MacroStabilityInwardsCalculatorFactory.Instance = previousFactory; + } } } } \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Kernels/MacroStabilityInwardsKernelFactoryConfig.cs =================================================================== diff -u -rbcb7ee1318355c19145c87d641d31c97307d59dd -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Kernels/MacroStabilityInwardsKernelFactoryConfig.cs (.../MacroStabilityInwardsKernelFactoryConfig.cs) (revision bcb7ee1318355c19145c87d641d31c97307d59dd) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/Kernels/MacroStabilityInwardsKernelFactoryConfig.cs (.../MacroStabilityInwardsKernelFactoryConfig.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -55,13 +55,22 @@ MacroStabilityInwardsKernelWrapperFactory.Instance = new TestMacroStabilityInwardsKernelFactory(); } + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + /// /// Reverts the to the value /// it had at time of construction of the . /// - public void Dispose() + protected virtual void Dispose(bool disposing) { - MacroStabilityInwardsKernelWrapperFactory.Instance = previousFactory; + if (disposing) + { + MacroStabilityInwardsKernelWrapperFactory.Instance = previousFactory; + } } } } \ No newline at end of file Index: Ringtoets/Piping/test/Ringtoets.Piping.KernelWrapper.TestUtil/SubCalculator/PipingSubCalculatorFactoryConfig.cs =================================================================== diff -u -r0c1eb485edd1764f19829f29bdad41e3343f35c1 -r94f14096f9a5565b9f961c7b7e1822ef0976a42a --- Ringtoets/Piping/test/Ringtoets.Piping.KernelWrapper.TestUtil/SubCalculator/PipingSubCalculatorFactoryConfig.cs (.../PipingSubCalculatorFactoryConfig.cs) (revision 0c1eb485edd1764f19829f29bdad41e3343f35c1) +++ Ringtoets/Piping/test/Ringtoets.Piping.KernelWrapper.TestUtil/SubCalculator/PipingSubCalculatorFactoryConfig.cs (.../PipingSubCalculatorFactoryConfig.cs) (revision 94f14096f9a5565b9f961c7b7e1822ef0976a42a) @@ -56,13 +56,22 @@ PipingSubCalculatorFactory.Instance = new TestPipingSubCalculatorFactory(); } + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + /// /// Reverts the to the value /// it had at time of construction of the . /// - public void Dispose() + protected virtual void Dispose(bool disposing) { - PipingSubCalculatorFactory.Instance = previousFactory; + if (disposing) + { + PipingSubCalculatorFactory.Instance = previousFactory; + } } } } \ No newline at end of file