Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/GrassCoverErosionInwards/GrassCoverErosionInwardsCalculationEntityReadExtensions.cs =================================================================== diff -u -rfe88135b797eda12b8e4d9b829036d2d7a52b10f -r72fae487f4d6debd3cec5157de8796827bf27a0c --- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/GrassCoverErosionInwards/GrassCoverErosionInwardsCalculationEntityReadExtensions.cs (.../GrassCoverErosionInwardsCalculationEntityReadExtensions.cs) (revision fe88135b797eda12b8e4d9b829036d2d7a52b10f) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/GrassCoverErosionInwards/GrassCoverErosionInwardsCalculationEntityReadExtensions.cs (.../GrassCoverErosionInwardsCalculationEntityReadExtensions.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) @@ -98,20 +98,12 @@ private static DikeProfile GetDikeProfileValue(DikeProfileEntity dikeProfileEntity, ReadConversionCollector collector) { - if (dikeProfileEntity != null) - { - return dikeProfileEntity.Read(collector); - } - return null; + return dikeProfileEntity?.Read(collector); } private static HydraulicBoundaryLocation GetHydraulicBoundaryLocationValue(HydraulicLocationEntity hydraulicLocationEntity, ReadConversionCollector collector) { - if (hydraulicLocationEntity != null) - { - return hydraulicLocationEntity.Read(collector); - } - return null; + return hydraulicLocationEntity?.Read(collector); } } } \ No newline at end of file Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/GrassCoverErosionOutwards/GrassCoverErosionOutwardsWaveConditionsCalculationEntityReadExtensions.cs =================================================================== diff -u -r0fbb881c5c82f540f01772234b3c1faadfab07f9 -r72fae487f4d6debd3cec5157de8796827bf27a0c --- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/GrassCoverErosionOutwards/GrassCoverErosionOutwardsWaveConditionsCalculationEntityReadExtensions.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationEntityReadExtensions.cs) (revision 0fbb881c5c82f540f01772234b3c1faadfab07f9) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/GrassCoverErosionOutwards/GrassCoverErosionOutwardsWaveConditionsCalculationEntityReadExtensions.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationEntityReadExtensions.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) @@ -96,22 +96,14 @@ private static ForeshoreProfile GetDikeProfileValue(ForeshoreProfileEntity foreshoreProfileEntity, ReadConversionCollector collector) { - if (foreshoreProfileEntity != null) - { - return foreshoreProfileEntity.Read(collector); - } - return null; + return foreshoreProfileEntity?.Read(collector); } private static HydraulicBoundaryLocation GetHydraulicBoundaryLocationValue( GrassCoverErosionOutwardsHydraulicLocationEntity hydraulicLocationEntity, ReadConversionCollector collector) { - if (hydraulicLocationEntity != null) - { - return hydraulicLocationEntity.Read(collector); - } - return null; + return hydraulicLocationEntity?.Read(collector); } } } \ No newline at end of file Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/StabilityStoneCover/StabilityStoneCoverWaveConditionsCalculationEntityReadExtensions.cs =================================================================== diff -u -r0fbb881c5c82f540f01772234b3c1faadfab07f9 -r72fae487f4d6debd3cec5157de8796827bf27a0c --- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/StabilityStoneCover/StabilityStoneCoverWaveConditionsCalculationEntityReadExtensions.cs (.../StabilityStoneCoverWaveConditionsCalculationEntityReadExtensions.cs) (revision 0fbb881c5c82f540f01772234b3c1faadfab07f9) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/StabilityStoneCover/StabilityStoneCoverWaveConditionsCalculationEntityReadExtensions.cs (.../StabilityStoneCoverWaveConditionsCalculationEntityReadExtensions.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) @@ -111,20 +111,12 @@ private static ForeshoreProfile GetDikeProfileValue(ForeshoreProfileEntity foreshoreProfileEntity, ReadConversionCollector collector) { - if (foreshoreProfileEntity != null) - { - return foreshoreProfileEntity.Read(collector); - } - return null; + return foreshoreProfileEntity?.Read(collector); } private static HydraulicBoundaryLocation GetHydraulicBoundaryLocationValue(HydraulicLocationEntity hydraulicLocationEntity, ReadConversionCollector collector) { - if (hydraulicLocationEntity != null) - { - return hydraulicLocationEntity.Read(collector); - } - return null; + return hydraulicLocationEntity?.Read(collector); } } } \ No newline at end of file Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/WaveImpactAsphaltCover/WaveImpactAsphaltCoverWaveConditionsCalculationEntityReadExtensions.cs =================================================================== diff -u -rb2b9fdf365e70928a05c57966eeed30d9050e528 -r72fae487f4d6debd3cec5157de8796827bf27a0c --- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/WaveImpactAsphaltCover/WaveImpactAsphaltCoverWaveConditionsCalculationEntityReadExtensions.cs (.../WaveImpactAsphaltCoverWaveConditionsCalculationEntityReadExtensions.cs) (revision b2b9fdf365e70928a05c57966eeed30d9050e528) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/WaveImpactAsphaltCover/WaveImpactAsphaltCoverWaveConditionsCalculationEntityReadExtensions.cs (.../WaveImpactAsphaltCoverWaveConditionsCalculationEntityReadExtensions.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) @@ -84,22 +84,14 @@ private static ForeshoreProfile GetDikeProfileValue(ForeshoreProfileEntity foreshoreProfileEntity, ReadConversionCollector collector) { - if (foreshoreProfileEntity != null) - { - return foreshoreProfileEntity.Read(collector); - } - return null; + return foreshoreProfileEntity?.Read(collector); } private static HydraulicBoundaryLocation GetHydraulicBoundaryLocationValue( HydraulicLocationEntity hydraulicLocationEntity, ReadConversionCollector collector) { - if (hydraulicLocationEntity != null) - { - return hydraulicLocationEntity.Read(collector); - } - return null; + return hydraulicLocationEntity?.Read(collector); } private static void ReadOutput(WaveImpactAsphaltCoverWaveConditionsCalculation calculation, WaveImpactAsphaltCoverWaveConditionsCalculationEntity entity) Index: Application/Ringtoets/src/Application.Ringtoets/App.xaml.cs =================================================================== diff -u -rf925c88f244ae719eda8ef70327ca4a33a1c6f98 -r72fae487f4d6debd3cec5157de8796827bf27a0c --- Application/Ringtoets/src/Application.Ringtoets/App.xaml.cs (.../App.xaml.cs) (revision f925c88f244ae719eda8ef70327ca4a33a1c6f98) +++ Application/Ringtoets/src/Application.Ringtoets/App.xaml.cs (.../App.xaml.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) @@ -101,10 +101,7 @@ protected override void OnExit(ExitEventArgs e) { - if (singleInstanceMutex != null) - { - singleInstanceMutex.ReleaseMutex(); - } + singleInstanceMutex?.ReleaseMutex(); base.OnExit(e); } @@ -332,10 +329,7 @@ { OpenLogClicked = () => { - if (gui.ApplicationCommands != null) - { - gui.ApplicationCommands.OpenLogFileExternal(); - } + gui.ApplicationCommands?.OpenLogFileExternal(); } }) { Index: Core/Common/src/Core.Common.Base/Observer.cs =================================================================== diff -u -r24da3aa72ccc0776599628c9f971081694048d9a -r72fae487f4d6debd3cec5157de8796827bf27a0c --- Core/Common/src/Core.Common.Base/Observer.cs (.../Observer.cs) (revision 24da3aa72ccc0776599628c9f971081694048d9a) +++ Core/Common/src/Core.Common.Base/Observer.cs (.../Observer.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) @@ -54,17 +54,11 @@ } set { - if (observable != null) - { - observable.Detach(this); - } + observable?.Detach(this); observable = value; - if (observable != null) - { - observable.Attach(this); - } + observable?.Attach(this); } } Index: Core/Common/src/Core.Common.Controls.TreeView/DragDropHandler.cs =================================================================== diff -u -r7ac739bd142fda419737a1e3ce328f373ab3531f -r72fae487f4d6debd3cec5157de8796827bf27a0c --- Core/Common/src/Core.Common.Controls.TreeView/DragDropHandler.cs (.../DragDropHandler.cs) (revision 7ac739bd142fda419737a1e3ce328f373ab3531f) +++ Core/Common/src/Core.Common.Controls.TreeView/DragDropHandler.cs (.../DragDropHandler.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) @@ -85,10 +85,7 @@ // Restore any lost selection treeView.SelectedNode = draggedNode; - if (treeNodeInfo.OnDrop != null) - { - treeNodeInfo.OnDrop(draggedNode.Tag, draggedNode.Parent.Tag, formerParentNode.Tag, dropAtLocation, treeViewControl); - } + treeNodeInfo.OnDrop?.Invoke(draggedNode.Tag, draggedNode.Parent.Tag, formerParentNode.Tag, dropAtLocation, treeViewControl); } /// @@ -264,19 +261,13 @@ if (delta < halfTreeViewHeight && delta > 0) { TreeNode nextVisibleNode = nodeOver.NextVisibleNode; - if (nextVisibleNode != null) - { - nextVisibleNode.EnsureVisible(); - } + nextVisibleNode?.EnsureVisible(); } if (delta > halfTreeViewHeight && delta < treeView.Height) { TreeNode previousVisibleNode = nodeOver.PrevVisibleNode; - if (previousVisibleNode != null) - { - previousVisibleNode.EnsureVisible(); - } + previousVisibleNode?.EnsureVisible(); } } Index: Core/Common/src/Core.Common.Controls.TreeView/TreeViewControl.cs =================================================================== diff -u -r7ac739bd142fda419737a1e3ce328f373ab3531f -r72fae487f4d6debd3cec5157de8796827bf27a0c --- Core/Common/src/Core.Common.Controls.TreeView/TreeViewControl.cs (.../TreeViewControl.cs) (revision 7ac739bd142fda419737a1e3ce328f373ab3531f) +++ Core/Common/src/Core.Common.Controls.TreeView/TreeViewControl.cs (.../TreeViewControl.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) @@ -724,10 +724,7 @@ private void OnNodeDataDeleted(TreeNode node) { - if (DataDeleted != null) - { - DataDeleted(this, new EventArgs(node.Tag)); - } + DataDeleted?.Invoke(this, new EventArgs(node.Tag)); } #region Nested types @@ -743,19 +740,13 @@ this.treeViewControl = treeViewControl; var observable = treeNode.Tag as IObservable; - if (observable != null) - { - observable.Attach(this); - } + observable?.Attach(this); } public void Dispose() { var observable = treeNode.Tag as IObservable; - if (observable != null) - { - observable.Detach(this); - } + observable?.Detach(this); } public void UpdateObserver() @@ -785,10 +776,7 @@ } TreeNodeInfo treeNodeInfo = TryGetTreeNodeInfoForData(e.Node.Tag); - if (treeNodeInfo.OnNodeRenamed != null) - { - treeNodeInfo.OnNodeRenamed(e.Node.Tag, e.Label); - } + treeNodeInfo.OnNodeRenamed?.Invoke(e.Node.Tag, e.Label); } private void TreeViewAfterCheck(object sender, TreeViewEventArgs e) @@ -911,10 +899,7 @@ private void UpdateContextMenuStrip(TreeNode node, TreeNodeInfo treeNodeInfo, object parentTag) { - if (node.ContextMenuStrip != null) - { - node.ContextMenuStrip.Dispose(); - } + node.ContextMenuStrip?.Dispose(); node.ContextMenuStrip = treeNodeInfo.ContextMenuStrip != null ? treeNodeInfo.ContextMenuStrip(node.Tag, parentTag, this) : null; @@ -932,10 +917,7 @@ private void OnDataDoubleClick() { - if (DataDoubleClick != null) - { - DataDoubleClick(treeView.SelectedNode, EventArgs.Empty); - } + DataDoubleClick?.Invoke(treeView.SelectedNode, EventArgs.Empty); } private void TreeViewDragDrop(object sender, DragEventArgs e) @@ -965,10 +947,7 @@ private void OnSelectedDataChanged() { - if (SelectedDataChanged != null) - { - SelectedDataChanged(this, EventArgs.Empty); - } + SelectedDataChanged?.Invoke(this, EventArgs.Empty); } #endregion Index: Core/Common/src/Core.Common.Controls/TextEditor/RichTextBoxControl.cs =================================================================== diff -u -re7e22e69b16b23c89c063f18444c82aa818dc176 -r72fae487f4d6debd3cec5157de8796827bf27a0c --- Core/Common/src/Core.Common.Controls/TextEditor/RichTextBoxControl.cs (.../RichTextBoxControl.cs) (revision e7e22e69b16b23c89c063f18444c82aa818dc176) +++ Core/Common/src/Core.Common.Controls/TextEditor/RichTextBoxControl.cs (.../RichTextBoxControl.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) @@ -95,10 +95,7 @@ private void OnTextBoxValueChanged(EventArgs e) { - if (TextBoxValueChanged != null) - { - TextBoxValueChanged(this, e); - } + TextBoxValueChanged?.Invoke(this, e); } private void OnKeyDown(object sender, KeyEventArgs e) Index: Core/Common/src/Core.Common.Gui/Appenders/RenderedMessageLogAppender.cs =================================================================== diff -u -r24da3aa72ccc0776599628c9f971081694048d9a -r72fae487f4d6debd3cec5157de8796827bf27a0c --- Core/Common/src/Core.Common.Gui/Appenders/RenderedMessageLogAppender.cs (.../RenderedMessageLogAppender.cs) (revision 24da3aa72ccc0776599628c9f971081694048d9a) +++ Core/Common/src/Core.Common.Gui/Appenders/RenderedMessageLogAppender.cs (.../RenderedMessageLogAppender.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) @@ -68,10 +68,7 @@ protected override void Append(LoggingEvent loggingEvent) { - if (AppendMessageLineAction != null) - { - AppendMessageLineAction(loggingEvent.RenderedMessage); - } + AppendMessageLineAction?.Invoke(loggingEvent.RenderedMessage); } } } \ No newline at end of file Index: Core/Common/src/Core.Common.Gui/Forms/ViewHost/AvalonDockViewHost.xaml.cs =================================================================== diff -u -r7ac739bd142fda419737a1e3ce328f373ab3531f -r72fae487f4d6debd3cec5157de8796827bf27a0c --- Core/Common/src/Core.Common.Gui/Forms/ViewHost/AvalonDockViewHost.xaml.cs (.../AvalonDockViewHost.xaml.cs) (revision 7ac739bd142fda419737a1e3ce328f373ab3531f) +++ Core/Common/src/Core.Common.Gui/Forms/ViewHost/AvalonDockViewHost.xaml.cs (.../AvalonDockViewHost.xaml.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) @@ -273,42 +273,27 @@ private void OnActiveDocumentViewChangingEvent() { - if (ActiveDocumentViewChanging != null) - { - ActiveDocumentViewChanging(this, new EventArgs()); - } + ActiveDocumentViewChanging?.Invoke(this, new EventArgs()); } private void OnActiveDocumentViewChangedEvent() { - if (ActiveDocumentViewChanged != null) - { - ActiveDocumentViewChanged(this, new EventArgs()); - } + ActiveDocumentViewChanged?.Invoke(this, new EventArgs()); } private void OnActiveViewChangedEvent() { - if (ActiveViewChanged != null) - { - ActiveViewChanged(this, new ViewChangeEventArgs(GetView(DockingManager.ActiveContent))); - } + ActiveViewChanged?.Invoke(this, new ViewChangeEventArgs(GetView(DockingManager.ActiveContent))); } private void OnViewOpenedEvent(IView view) { - if (ViewOpened != null) - { - ViewOpened(this, new ViewChangeEventArgs(view)); - } + ViewOpened?.Invoke(this, new ViewChangeEventArgs(view)); } private void OnViewClosedEvent(IView view) { - if (ViewClosed != null) - { - ViewClosed(this, new ViewChangeEventArgs(view)); - } + ViewClosed?.Invoke(this, new ViewChangeEventArgs(view)); } private void OnActiveContentChanged(object sender, EventArgs eventArgs) Index: Core/Common/src/Core.Common.Gui/GuiCore.cs =================================================================== diff -u -r558a1d00dac7f8ee16b4c5784cf4945ca12b7037 -r72fae487f4d6debd3cec5157de8796827bf27a0c --- Core/Common/src/Core.Common.Gui/GuiCore.cs (.../GuiCore.cs) (revision 558a1d00dac7f8ee16b4c5784cf4945ca12b7037) +++ Core/Common/src/Core.Common.Gui/GuiCore.cs (.../GuiCore.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) @@ -246,10 +246,7 @@ isExiting = true; - if (mainWindow != null) - { - mainWindow.UnsubscribeFromGui(); - } + mainWindow?.UnsubscribeFromGui(); Selection = null; @@ -294,61 +291,40 @@ BindingFlags.Static | BindingFlags.NonPublic); var propertyCache = (Hashtable) propertyCacheInfo.GetValue(null); - if (propertyCache != null) - { - propertyCache.Clear(); - } + propertyCache?.Clear(); FieldInfo extendedPropertyCacheInfo = reflectTypeDescriptionProviderType.GetField( "_extendedPropertyCache", BindingFlags.Static | BindingFlags.NonPublic); var extendedPropertyCache = extendedPropertyCacheInfo.GetValue(null) as Hashtable; - if (extendedPropertyCache != null) - { - extendedPropertyCache.Clear(); - } + extendedPropertyCache?.Clear(); FieldInfo eventCacheInfo = reflectTypeDescriptionProviderType.GetField("_eventCache", BindingFlags.Static | BindingFlags.NonPublic); var eventCache = eventCacheInfo.GetValue(null) as Hashtable; - if (eventCache != null) - { - eventCache.Clear(); - } + eventCache?.Clear(); FieldInfo attributeCacheInfo = reflectTypeDescriptionProviderType.GetField("_attributeCache", BindingFlags.Static | BindingFlags.NonPublic); var attributeCache = attributeCacheInfo.GetValue(null) as Hashtable; - if (attributeCache != null) - { - attributeCache.Clear(); - } + attributeCache?.Clear(); Type typeDescriptorType = systemAssembly.GetType("System.ComponentModel.TypeDescriptor"); FieldInfo providerTableInfo = typeDescriptorType.GetField("_providerTable", BindingFlags.Static | BindingFlags.NonPublic); var providerTable = providerTableInfo.GetValue(null) as Hashtable; - if (providerTable != null) - { - providerTable.Clear(); - } + providerTable?.Clear(); FieldInfo providerTypeTableInfo = typeDescriptorType.GetField("_providerTypeTable", BindingFlags.Static | BindingFlags.NonPublic); var providerTypeTable = providerTypeTableInfo.GetValue(null) as Hashtable; - if (providerTypeTable != null) - { - providerTypeTable.Clear(); - } + providerTypeTable?.Clear(); FieldInfo defaultProvidersInfo = typeDescriptorType.GetField("_defaultProviders", BindingFlags.Static | BindingFlags.NonPublic); var defaultProviders = defaultProvidersInfo.GetValue(null) as Hashtable; - if (defaultProviders != null) - { - defaultProviders.Clear(); - } + defaultProviders?.Clear(); #endregion @@ -385,10 +361,7 @@ private void ApplicationProjectOpened(IProject newProject) { - if (mainWindow != null) - { - mainWindow.ValidateItems(); - } + mainWindow?.ValidateItems(); projectObserver.Observable = newProject; UpdateTitle(); @@ -636,18 +609,12 @@ private void OnBeforeProjectOpened() { - if (BeforeProjectOpened != null) - { - BeforeProjectOpened(project); - } + BeforeProjectOpened?.Invoke(project); } private void OnProjectOpened() { - if (ProjectOpened != null) - { - ProjectOpened(project); - } + ProjectOpened?.Invoke(project); } public void SetProject(IProject newProject, string projectPath) Index: Core/Common/src/Core.Common.Gui/Plugin/ViewInfo.cs =================================================================== diff -u -r8905298103eb01ce13dd5c1a2f267f879d4fda3e -r72fae487f4d6debd3cec5157de8796827bf27a0c --- Core/Common/src/Core.Common.Gui/Plugin/ViewInfo.cs (.../ViewInfo.cs) (revision 8905298103eb01ce13dd5c1a2f267f879d4fda3e) +++ Core/Common/src/Core.Common.Gui/Plugin/ViewInfo.cs (.../ViewInfo.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) @@ -263,10 +263,7 @@ CloseForData = (v, o) => viewInfo.CloseForData != null && viewInfo.CloseForData((TView) v, o), AfterCreate = (v, o) => { - if (viewInfo.AfterCreate != null) - { - viewInfo.AfterCreate((TView) v, (TData) o); - } + viewInfo.AfterCreate?.Invoke((TView) v, (TData) o); }, GetViewName = (v, o) => viewInfo.GetViewName != null ? viewInfo.GetViewName((TView) v, (TViewData) o) : null, CreateInstance = () => viewInfo.CreateInstance() Index: Core/Common/test/Core.Common.Gui.Test/GuiCoreTest.cs =================================================================== diff -u -r9cdd70c8d4ba76d93b72ef8c1b7df138fa73b0e4 -r72fae487f4d6debd3cec5157de8796827bf27a0c --- Core/Common/test/Core.Common.Gui.Test/GuiCoreTest.cs (.../GuiCoreTest.cs) (revision 9cdd70c8d4ba76d93b72ef8c1b7df138fa73b0e4) +++ Core/Common/test/Core.Common.Gui.Test/GuiCoreTest.cs (.../GuiCoreTest.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) @@ -1551,10 +1551,7 @@ { Selection = new object(); - if (SelectionChanged != null) - { - SelectionChanged(this, new EventArgs()); - } + SelectionChanged?.Invoke(this, new EventArgs()); } } Index: Core/Components/src/Core.Components.Gis.IO/Readers/ShapeFileReaderBase.cs =================================================================== diff -u -r7ac739bd142fda419737a1e3ce328f373ab3531f -r72fae487f4d6debd3cec5157de8796827bf27a0c --- Core/Components/src/Core.Components.Gis.IO/Readers/ShapeFileReaderBase.cs (.../ShapeFileReaderBase.cs) (revision 7ac739bd142fda419737a1e3ce328f373ab3531f) +++ Core/Components/src/Core.Components.Gis.IO/Readers/ShapeFileReaderBase.cs (.../ShapeFileReaderBase.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) @@ -106,10 +106,7 @@ public void Dispose() { - if (ShapeFile != null) - { - ShapeFile.Close(); - } + ShapeFile?.Close(); } /// Index: Core/Components/src/Core.Components.Gis.IO/Writers/ShapeFileWriterBase.cs =================================================================== diff -u -r16bd8076863c03907abeee60b16704aba1bdb1a0 -r72fae487f4d6debd3cec5157de8796827bf27a0c --- Core/Components/src/Core.Components.Gis.IO/Writers/ShapeFileWriterBase.cs (.../ShapeFileWriterBase.cs) (revision 16bd8076863c03907abeee60b16704aba1bdb1a0) +++ Core/Components/src/Core.Components.Gis.IO/Writers/ShapeFileWriterBase.cs (.../ShapeFileWriterBase.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) @@ -93,10 +93,7 @@ public void Dispose() { - if (ShapeFile != null) - { - ShapeFile.Close(); - } + ShapeFile?.Close(); } /// Index: Core/Plugins/src/Core.Plugins.Chart/Legend/ChartLegendController.cs =================================================================== diff -u -rb2b9fdf365e70928a05c57966eeed30d9050e528 -r72fae487f4d6debd3cec5157de8796827bf27a0c --- Core/Plugins/src/Core.Plugins.Chart/Legend/ChartLegendController.cs (.../ChartLegendController.cs) (revision b2b9fdf365e70928a05c57966eeed30d9050e528) +++ Core/Plugins/src/Core.Plugins.Chart/Legend/ChartLegendController.cs (.../ChartLegendController.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) @@ -105,10 +105,7 @@ viewController.ViewHost.AddToolView(legendView, ToolViewLocation.Left); viewController.ViewHost.SetImage(legendView, Resources.ChartIcon); - if (OnOpenLegend != null) - { - OnOpenLegend(this, EventArgs.Empty); - } + OnOpenLegend?.Invoke(this, EventArgs.Empty); } /// Index: Core/Plugins/src/Core.Plugins.Chart/Legend/ChartLegendView.cs =================================================================== diff -u -r7ac739bd142fda419737a1e3ce328f373ab3531f -r72fae487f4d6debd3cec5157de8796827bf27a0c --- Core/Plugins/src/Core.Plugins.Chart/Legend/ChartLegendView.cs (.../ChartLegendView.cs) (revision 7ac739bd142fda419737a1e3ce328f373ab3531f) +++ Core/Plugins/src/Core.Plugins.Chart/Legend/ChartLegendView.cs (.../ChartLegendView.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) @@ -99,10 +99,7 @@ chartData.NotifyObservers(); var observableParent = Data as IObservable; - if (observableParent != null) - { - observableParent.NotifyObservers(); - } + observableParent?.NotifyObservers(); } #region ChartDataContext Index: Core/Plugins/src/Core.Plugins.ProjectExplorer/ProjectExplorer.cs =================================================================== diff -u -rb2b9fdf365e70928a05c57966eeed30d9050e528 -r72fae487f4d6debd3cec5157de8796827bf27a0c --- Core/Plugins/src/Core.Plugins.ProjectExplorer/ProjectExplorer.cs (.../ProjectExplorer.cs) (revision b2b9fdf365e70928a05c57966eeed30d9050e528) +++ Core/Plugins/src/Core.Plugins.ProjectExplorer/ProjectExplorer.cs (.../ProjectExplorer.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) @@ -112,10 +112,7 @@ private void TreeViewControlSelectedDataChanged(object sender, EventArgs e) { - if (SelectionChanged != null) - { - SelectionChanged(this, new EventArgs()); - } + SelectionChanged?.Invoke(this, new EventArgs()); } private void TreeViewControlDataDoubleClick(object sender, EventArgs e) Index: Core/Plugins/src/Core.Plugins.ProjectExplorer/ProjectExplorerViewController.cs =================================================================== diff -u -rb2b9fdf365e70928a05c57966eeed30d9050e528 -r72fae487f4d6debd3cec5157de8796827bf27a0c --- Core/Plugins/src/Core.Plugins.ProjectExplorer/ProjectExplorerViewController.cs (.../ProjectExplorerViewController.cs) (revision b2b9fdf365e70928a05c57966eeed30d9050e528) +++ Core/Plugins/src/Core.Plugins.ProjectExplorer/ProjectExplorerViewController.cs (.../ProjectExplorerViewController.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) @@ -138,10 +138,7 @@ viewController.ViewHost.AddToolView(projectExplorer, ToolViewLocation.Left); viewController.ViewHost.SetImage(projectExplorer, Resources.ProjectExplorerIcon); - if (OnOpenView != null) - { - OnOpenView(this, EventArgs.Empty); - } + OnOpenView?.Invoke(this, EventArgs.Empty); } private void CloseProjectExplorer() Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Views/ClosingStructuresScenariosView.cs =================================================================== diff -u -ra25d8e273425a90e4a8fa870f5fb624f7684ef20 -r72fae487f4d6debd3cec5157de8796827bf27a0c --- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Views/ClosingStructuresScenariosView.cs (.../ClosingStructuresScenariosView.cs) (revision a25d8e273425a90e4a8fa870f5fb624f7684ef20) +++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Views/ClosingStructuresScenariosView.cs (.../ClosingStructuresScenariosView.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) @@ -104,16 +104,13 @@ protected override void Dispose(bool disposing) { - if (failureMechanismObserver != null) - { - failureMechanismObserver.Dispose(); - } + failureMechanismObserver?.Dispose(); calculationInputObserver.Dispose(); calculationGroupObserver.Dispose(); - if (disposing && components != null) + if (disposing) { - components.Dispose(); + components?.Dispose(); } base.Dispose(disposing); Index: Ringtoets/Common/src/Ringtoets.Common.Forms/SelectionDialogBase.cs =================================================================== diff -u -ra25d8e273425a90e4a8fa870f5fb624f7684ef20 -r72fae487f4d6debd3cec5157de8796827bf27a0c --- Ringtoets/Common/src/Ringtoets.Common.Forms/SelectionDialogBase.cs (.../SelectionDialogBase.cs) (revision a25d8e273425a90e4a8fa870f5fb624f7684ef20) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/SelectionDialogBase.cs (.../SelectionDialogBase.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) @@ -70,9 +70,9 @@ protected override void Dispose(bool disposing) { - if (disposing && components != null) + if (disposing) { - components.Dispose(); + components?.Dispose(); } base.Dispose(disposing); } Index: Ringtoets/Common/src/Ringtoets.Common.Forms/TreeNodeInfos/RingtoetsContextMenuItemFactory.cs =================================================================== diff -u -ra1bba29ba0d84061cca88da8324957087d564db9 -r72fae487f4d6debd3cec5157de8796827bf27a0c --- Ringtoets/Common/src/Ringtoets.Common.Forms/TreeNodeInfos/RingtoetsContextMenuItemFactory.cs (.../RingtoetsContextMenuItemFactory.cs) (revision a1bba29ba0d84061cca88da8324957087d564db9) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/TreeNodeInfos/RingtoetsContextMenuItemFactory.cs (.../RingtoetsContextMenuItemFactory.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) @@ -358,10 +358,7 @@ checkboxImage, (sender, args) => { - if (onChangeAction != null) - { - onChangeAction(failureMechanismContext); - } + onChangeAction?.Invoke(failureMechanismContext); failureMechanismContext.WrappedData.IsRelevant = !isRelevant; failureMechanismContext.WrappedData.NotifyObservers(); Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Views/FailureMechanismResultView.cs =================================================================== diff -u -ra25d8e273425a90e4a8fa870f5fb624f7684ef20 -r72fae487f4d6debd3cec5157de8796827bf27a0c --- Ringtoets/Common/src/Ringtoets.Common.Forms/Views/FailureMechanismResultView.cs (.../FailureMechanismResultView.cs) (revision a25d8e273425a90e4a8fa870f5fb624f7684ef20) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Views/FailureMechanismResultView.cs (.../FailureMechanismResultView.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) @@ -121,14 +121,11 @@ { FailureMechanism = null; FailureMechanismSectionResult = null; - if (failureMechanismObserver != null) - { - failureMechanismObserver.Dispose(); - } + failureMechanismObserver?.Dispose(); - if (disposing && components != null) + if (disposing) { - components.Dispose(); + components?.Dispose(); } base.Dispose(disposing); } Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsInputView.cs =================================================================== diff -u -ra25d8e273425a90e4a8fa870f5fb624f7684ef20 -r72fae487f4d6debd3cec5157de8796827bf27a0c --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsInputView.cs (.../GrassCoverErosionInwardsInputView.cs) (revision a25d8e273425a90e4a8fa870f5fb624f7684ef20) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsInputView.cs (.../GrassCoverErosionInwardsInputView.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) @@ -105,9 +105,9 @@ calculationObserver.Dispose(); calculationInputObserver.Dispose(); - if (disposing && components != null) + if (disposing) { - components.Dispose(); + components?.Dispose(); } base.Dispose(disposing); } Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsScenariosView.cs =================================================================== diff -u -ra25d8e273425a90e4a8fa870f5fb624f7684ef20 -r72fae487f4d6debd3cec5157de8796827bf27a0c --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsScenariosView.cs (.../GrassCoverErosionInwardsScenariosView.cs) (revision a25d8e273425a90e4a8fa870f5fb624f7684ef20) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsScenariosView.cs (.../GrassCoverErosionInwardsScenariosView.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) @@ -103,16 +103,13 @@ protected override void Dispose(bool disposing) { - if (failureMechanismObserver != null) - { - failureMechanismObserver.Dispose(); - } + failureMechanismObserver?.Dispose(); calculationInputObserver.Dispose(); calculationGroupObserver.Dispose(); - if (disposing && components != null) + if (disposing) { - components.Dispose(); + components?.Dispose(); } base.Dispose(disposing); Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresScenariosView.cs =================================================================== diff -u -ra25d8e273425a90e4a8fa870f5fb624f7684ef20 -r72fae487f4d6debd3cec5157de8796827bf27a0c --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresScenariosView.cs (.../HeightStructuresScenariosView.cs) (revision a25d8e273425a90e4a8fa870f5fb624f7684ef20) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresScenariosView.cs (.../HeightStructuresScenariosView.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) @@ -104,16 +104,13 @@ protected override void Dispose(bool disposing) { - if (failureMechanismObserver != null) - { - failureMechanismObserver.Dispose(); - } + failureMechanismObserver?.Dispose(); calculationInputObserver.Dispose(); calculationGroupObserver.Dispose(); - if (disposing && components != null) + if (disposing) { - components.Dispose(); + components?.Dispose(); } base.Dispose(disposing); Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.IO/HydraulicBoundaryDatabaseContext/HydraulicBoundarySqLiteDatabaseReader.cs =================================================================== diff -u -ra1bba29ba0d84061cca88da8324957087d564db9 -r72fae487f4d6debd3cec5157de8796827bf27a0c --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.IO/HydraulicBoundaryDatabaseContext/HydraulicBoundarySqLiteDatabaseReader.cs (.../HydraulicBoundarySqLiteDatabaseReader.cs) (revision a1bba29ba0d84061cca88da8324957087d564db9) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.IO/HydraulicBoundaryDatabaseContext/HydraulicBoundarySqLiteDatabaseReader.cs (.../HydraulicBoundarySqLiteDatabaseReader.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) @@ -222,10 +222,7 @@ private void CloseDataReader() { - if (sqliteDataReader != null) - { - sqliteDataReader.Dispose(); - } + sqliteDataReader?.Dispose(); } } } \ No newline at end of file Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.IO.Test/HydraulicBoundaryDatabaseContext/HydraulicBoundarySqLiteDatabaseReaderTest.cs =================================================================== diff -u -r9cdd70c8d4ba76d93b72ef8c1b7df138fa73b0e4 -r72fae487f4d6debd3cec5157de8796827bf27a0c --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.IO.Test/HydraulicBoundaryDatabaseContext/HydraulicBoundarySqLiteDatabaseReaderTest.cs (.../HydraulicBoundarySqLiteDatabaseReaderTest.cs) (revision 9cdd70c8d4ba76d93b72ef8c1b7df138fa73b0e4) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.IO.Test/HydraulicBoundaryDatabaseContext/HydraulicBoundarySqLiteDatabaseReaderTest.cs (.../HydraulicBoundarySqLiteDatabaseReaderTest.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) @@ -384,10 +384,7 @@ finally { // Call - if (hydraulicBoundarySqLiteDatabaseReader != null) - { - hydraulicBoundarySqLiteDatabaseReader.Dispose(); - } + hydraulicBoundarySqLiteDatabaseReader?.Dispose(); } // Assert Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/FailureMechanismContributionView.cs =================================================================== diff -u -ra1bba29ba0d84061cca88da8324957087d564db9 -r72fae487f4d6debd3cec5157de8796827bf27a0c --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/FailureMechanismContributionView.cs (.../FailureMechanismContributionView.cs) (revision a1bba29ba0d84061cca88da8324957087d564db9) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/FailureMechanismContributionView.cs (.../FailureMechanismContributionView.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) @@ -122,10 +122,7 @@ { if (disposing) { - if (components != null) - { - components.Dispose(); - } + components?.Dispose(); UnsubscribeEvents(); DetachFromFailureMechanisms(); } @@ -203,18 +200,12 @@ private void AttachToData() { - if (data != null) - { - data.Attach(this); - } + data?.Attach(this); } private void DetachFromData() { - if (data != null) - { - data.Detach(this); - } + data?.Detach(this); } private void SetReturnPeriodText() Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingCalculationScenarioExtensions.cs =================================================================== diff -u -r6afbb616ce84cccaf56617d60c5cd821b00daab0 -r72fae487f4d6debd3cec5157de8796827bf27a0c --- Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingCalculationScenarioExtensions.cs (.../PipingCalculationScenarioExtensions.cs) (revision 6afbb616ce84cccaf56617d60c5cd821b00daab0) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingCalculationScenarioExtensions.cs (.../PipingCalculationScenarioExtensions.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) @@ -41,12 +41,7 @@ /// Thrown when contains no elements. public static bool IsSurfaceLineIntersectionWithReferenceLineInSection(this PipingCalculationScenario pipingCalculationScenario, IEnumerable lineSegments) { - if (pipingCalculationScenario == null) - { - return false; - } - - RingtoetsPipingSurfaceLine surfaceLine = pipingCalculationScenario.InputParameters.SurfaceLine; + RingtoetsPipingSurfaceLine surfaceLine = pipingCalculationScenario?.InputParameters.SurfaceLine; if (surfaceLine == null) { return false; Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingInputView.cs =================================================================== diff -u -ra25d8e273425a90e4a8fa870f5fb624f7684ef20 -r72fae487f4d6debd3cec5157de8796827bf27a0c --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingInputView.cs (.../PipingInputView.cs) (revision a25d8e273425a90e4a8fa870f5fb624f7684ef20) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingInputView.cs (.../PipingInputView.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) @@ -137,9 +137,9 @@ calculationObserver.Dispose(); calculationInputObserver.Dispose(); - if (disposing && components != null) + if (disposing) { - components.Dispose(); + components?.Dispose(); } base.Dispose(disposing); } Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingScenariosView.cs =================================================================== diff -u -ra25d8e273425a90e4a8fa870f5fb624f7684ef20 -r72fae487f4d6debd3cec5157de8796827bf27a0c --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingScenariosView.cs (.../PipingScenariosView.cs) (revision a25d8e273425a90e4a8fa870f5fb624f7684ef20) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingScenariosView.cs (.../PipingScenariosView.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) @@ -116,9 +116,9 @@ pipingCalculationObserver.Dispose(); pipingCalculationGroupObserver.Dispose(); - if (disposing && components != null) + if (disposing) { - components.Dispose(); + components?.Dispose(); } base.Dispose(disposing); Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/SoilProfile/StochasticSoilModelReader.cs =================================================================== diff -u -r6afbb616ce84cccaf56617d60c5cd821b00daab0 -r72fae487f4d6debd3cec5157de8796827bf27a0c --- Ringtoets/Piping/src/Ringtoets.Piping.IO/SoilProfile/StochasticSoilModelReader.cs (.../StochasticSoilModelReader.cs) (revision 6afbb616ce84cccaf56617d60c5cd821b00daab0) +++ Ringtoets/Piping/src/Ringtoets.Piping.IO/SoilProfile/StochasticSoilModelReader.cs (.../StochasticSoilModelReader.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) @@ -99,10 +99,7 @@ public override void Dispose() { - if (dataReader != null) - { - dataReader.Dispose(); - } + dataReader?.Dispose(); base.Dispose(); } Index: Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/SoilProfile/PipingSoilProfileReaderTest.cs =================================================================== diff -u -ra25d8e273425a90e4a8fa870f5fb624f7684ef20 -r72fae487f4d6debd3cec5157de8796827bf27a0c --- Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/SoilProfile/PipingSoilProfileReaderTest.cs (.../PipingSoilProfileReaderTest.cs) (revision a25d8e273425a90e4a8fa870f5fb624f7684ef20) +++ Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/SoilProfile/PipingSoilProfileReaderTest.cs (.../PipingSoilProfileReaderTest.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) @@ -579,10 +579,7 @@ finally { // Call - if (pipingSoilProfilesReader != null) - { - pipingSoilProfilesReader.Dispose(); - } + pipingSoilProfilesReader?.Dispose(); } // Assert Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Views/StabilityPointStructuresScenariosView.cs =================================================================== diff -u -ra25d8e273425a90e4a8fa870f5fb624f7684ef20 -r72fae487f4d6debd3cec5157de8796827bf27a0c --- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Views/StabilityPointStructuresScenariosView.cs (.../StabilityPointStructuresScenariosView.cs) (revision a25d8e273425a90e4a8fa870f5fb624f7684ef20) +++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Views/StabilityPointStructuresScenariosView.cs (.../StabilityPointStructuresScenariosView.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) @@ -104,16 +104,13 @@ protected override void Dispose(bool disposing) { - if (failureMechanismObserver != null) - { - failureMechanismObserver.Dispose(); - } + failureMechanismObserver?.Dispose(); calculationInputObserver.Dispose(); calculationGroupObserver.Dispose(); - if (disposing && components != null) + if (disposing) { - components.Dispose(); + components?.Dispose(); } base.Dispose(disposing);