Index: Application/Ringtoets/src/Application.Ringtoets/App.xaml.cs =================================================================== diff -u -r72fae487f4d6debd3cec5157de8796827bf27a0c -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Application/Ringtoets/src/Application.Ringtoets/App.xaml.cs (.../App.xaml.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) +++ Application/Ringtoets/src/Application.Ringtoets/App.xaml.cs (.../App.xaml.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -323,7 +323,7 @@ { log.Error(CoreCommonGuiResources.App_Unhandled_exception, exception); - if (gui != null && gui.MainWindow != null) + if (gui?.MainWindow != null) { using (var exceptionDialog = new ExceptionDialog(gui.MainWindow, gui, exception) { @@ -422,12 +422,9 @@ .SelectMany(r => r.GetAppenders()) .OfType() .FirstOrDefault(); - if (fileAppender == null || string.IsNullOrWhiteSpace(fileAppender.File)) - { - return string.Empty; - } - - return Path.GetDirectoryName(fileAppender.File); + return string.IsNullOrWhiteSpace(fileAppender?.File) + ? string.Empty + : Path.GetDirectoryName(fileAppender.File); } } } \ No newline at end of file Index: Core/Common/src/Core.Common.Controls.TreeView/DragDropHandler.cs =================================================================== diff -u -r72fae487f4d6debd3cec5157de8796827bf27a0c -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Core/Common/src/Core.Common.Controls.TreeView/DragDropHandler.cs (.../DragDropHandler.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) +++ Core/Common/src/Core.Common.Controls.TreeView/DragDropHandler.cs (.../DragDropHandler.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -159,7 +159,7 @@ var draggedNode = (TreeNode) e.Item; treeView.SelectedNode = draggedNode; TreeNodeInfo treeNodeInfo = getTreeNodeInfoForData(draggedNode.Tag); - object parentTag = draggedNode.Parent != null ? draggedNode.Parent.Tag : null; + object parentTag = draggedNode.Parent?.Tag; if (treeNodeInfo.CanDrag == null || !treeNodeInfo.CanDrag(draggedNode.Tag, parentTag)) { @@ -240,7 +240,7 @@ private static bool IsDropTargetChildOfDraggedNode(TreeNode dropTarget, TreeNode draggedNode) { - while (dropTarget != null && dropTarget.Parent != null) + while (dropTarget?.Parent != null) { if (dropTarget.Parent.Equals(draggedNode)) { @@ -284,7 +284,7 @@ if (treeNodeInfo.CanInsert != null && treeNodeInfo.CanInsert(nodeDragging.Tag, nodeOver.Parent.Tag)) { nodeDropTarget = nodeOver.Parent; - dropAtLocation = nodeOver.Parent == null ? 0 : nodeOver.Parent.Nodes.IndexOf(nodeOver); + dropAtLocation = nodeOver.Parent.Nodes.IndexOf(nodeOver); placeholderLocation = PlaceholderLocation.Top; } else @@ -309,9 +309,7 @@ if (treeNodeInfo.CanInsert != null && treeNodeInfo.CanInsert(nodeDragging.Tag, nodeOver.Parent.Tag)) { nodeDropTarget = nodeOver.Parent; - dropAtLocation = nodeOver.Parent != null - ? nodeOver.Parent.Nodes.IndexOf(nodeOver) + 1 - : 0; + dropAtLocation = nodeOver.Parent.Nodes.IndexOf(nodeOver) + 1; placeholderLocation = PlaceholderLocation.Bottom; } else Index: Core/Common/src/Core.Common.Controls.TreeView/TreeViewControl.cs =================================================================== diff -u -r72fae487f4d6debd3cec5157de8796827bf27a0c -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Core/Common/src/Core.Common.Controls.TreeView/TreeViewControl.cs (.../TreeViewControl.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) +++ Core/Common/src/Core.Common.Controls.TreeView/TreeViewControl.cs (.../TreeViewControl.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -168,7 +168,7 @@ { get { - return treeView.SelectedNode != null ? treeView.SelectedNode.Tag : null; + return treeView.SelectedNode?.Tag; } } @@ -337,7 +337,7 @@ { TreeNode treeNode = GetNodeByTag(dataObject); - return treeNode != null ? treeNode.FullPath : null; + return treeNode?.FullPath; } private bool CanRename(TreeNode treeNode) @@ -548,9 +548,7 @@ treeNode.Text = ""; } - treeNode.ForeColor = treeNodeInfo.ForeColor != null - ? treeNodeInfo.ForeColor(treeNode.Tag) - : Color.FromKnownColor(KnownColor.ControlText); + treeNode.ForeColor = treeNodeInfo.ForeColor?.Invoke(treeNode.Tag) ?? Color.FromKnownColor(KnownColor.ControlText); SetTreeNodeImageKey(treeNode, treeNodeInfo); if (treeNodeInfo.CanCheck != null && treeNodeInfo.CanCheck(treeNode.Tag) && @@ -675,7 +673,7 @@ private static object GetParentTag(TreeNode treeNode) { - return treeNode.Parent != null ? treeNode.Parent.Tag : null; + return treeNode.Parent?.Tag; } private static Image CreateCheckBoxGlyph(CheckBoxState state) @@ -900,9 +898,7 @@ private void UpdateContextMenuStrip(TreeNode node, TreeNodeInfo treeNodeInfo, object parentTag) { node.ContextMenuStrip?.Dispose(); - node.ContextMenuStrip = treeNodeInfo.ContextMenuStrip != null - ? treeNodeInfo.ContextMenuStrip(node.Tag, parentTag, this) - : null; + node.ContextMenuStrip = treeNodeInfo.ContextMenuStrip?.Invoke(node.Tag, parentTag, this); } private bool IsOnCheckBox(Point point) Index: Core/Common/src/Core.Common.Gui/Commands/ApplicationFeatureCommandHandler.cs =================================================================== diff -u -r7ac739bd142fda419737a1e3ce328f373ab3531f -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Core/Common/src/Core.Common.Gui/Commands/ApplicationFeatureCommandHandler.cs (.../ApplicationFeatureCommandHandler.cs) (revision 7ac739bd142fda419737a1e3ce328f373ab3531f) +++ Core/Common/src/Core.Common.Gui/Commands/ApplicationFeatureCommandHandler.cs (.../ApplicationFeatureCommandHandler.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -69,7 +69,7 @@ .SelectMany(r => r.GetAppenders()) .OfType() .FirstOrDefault(); - if (fileAppender == null || string.IsNullOrWhiteSpace(fileAppender.File)) + if (string.IsNullOrWhiteSpace(fileAppender?.File)) { return; } Index: Core/Common/src/Core.Common.Gui/Forms/MainWindow/MainWindow.xaml.cs =================================================================== diff -u -r558a1d00dac7f8ee16b4c5784cf4945ca12b7037 -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Core/Common/src/Core.Common.Gui/Forms/MainWindow/MainWindow.xaml.cs (.../MainWindow.xaml.cs) (revision 558a1d00dac7f8ee16b4c5784cf4945ca12b7037) +++ Core/Common/src/Core.Common.Gui/Forms/MainWindow/MainWindow.xaml.cs (.../MainWindow.xaml.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -197,7 +197,7 @@ /// public void SubscribeToGui() { - if (viewController != null && viewController.ViewHost != null) + if (viewController?.ViewHost != null) { viewController.ViewHost.ViewClosed += OnViewClosed; viewController.ViewHost.ActiveDocumentViewChanged += OnActiveDocumentViewChanged; @@ -210,7 +210,7 @@ /// public void UnsubscribeFromGui() { - if (viewController != null && viewController.ViewHost != null) + if (viewController?.ViewHost != null) { viewController.ViewHost.ViewClosed -= OnViewClosed; viewController.ViewHost.ActiveDocumentViewChanged -= OnActiveDocumentViewChanged; Index: Core/Common/src/Core.Common.Gui/Forms/ViewHost/AvalonDockViewHost.xaml.cs =================================================================== diff -u -r72fae487f4d6debd3cec5157de8796827bf27a0c -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Core/Common/src/Core.Common.Gui/Forms/ViewHost/AvalonDockViewHost.xaml.cs (.../AvalonDockViewHost.xaml.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) +++ Core/Common/src/Core.Common.Gui/Forms/ViewHost/AvalonDockViewHost.xaml.cs (.../AvalonDockViewHost.xaml.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -454,7 +454,7 @@ layoutAnchorablePaneGroup = RightLayoutAnchorablePaneGroup; break; default: - throw new InvalidEnumArgumentException("toolViewLocation", (int) toolViewLocation, typeof(ToolViewLocation)); + throw new InvalidEnumArgumentException(nameof(toolViewLocation), (int) toolViewLocation, typeof(ToolViewLocation)); } layoutAnchorablePaneGroup.Descendents() @@ -466,7 +466,7 @@ private static IView GetView(object content) { var windowsFormsHost = content as WindowsFormsHost; - return windowsFormsHost != null ? windowsFormsHost.Child as IView : null; + return windowsFormsHost?.Child as IView; } } } \ No newline at end of file Index: Core/Common/src/Core.Common.Gui/Plugin/ExportInfo.cs =================================================================== diff -u -r92056906158ddd85bd0b82da96167997e08c289a -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Core/Common/src/Core.Common.Gui/Plugin/ExportInfo.cs (.../ExportInfo.cs) (revision 92056906158ddd85bd0b82da96167997e08c289a) +++ Core/Common/src/Core.Common.Gui/Plugin/ExportInfo.cs (.../ExportInfo.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -146,9 +146,7 @@ return new ExportInfo { DataType = exportInfo.DataType, - CreateFileExporter = (data, filePath) => exportInfo.CreateFileExporter != null ? - exportInfo.CreateFileExporter((TData) data, filePath) : - null, + CreateFileExporter = (data, filePath) => exportInfo.CreateFileExporter?.Invoke((TData) data, filePath), IsEnabled = data => exportInfo.IsEnabled == null || exportInfo.IsEnabled((TData) data), Name = exportInfo.Name, Category = exportInfo.Category, Index: Core/Common/src/Core.Common.Gui/Plugin/ViewInfo.cs =================================================================== diff -u -r72fae487f4d6debd3cec5157de8796827bf27a0c -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Core/Common/src/Core.Common.Gui/Plugin/ViewInfo.cs (.../ViewInfo.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) +++ Core/Common/src/Core.Common.Gui/Plugin/ViewInfo.cs (.../ViewInfo.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -265,7 +265,7 @@ { viewInfo.AfterCreate?.Invoke((TView) v, (TData) o); }, - GetViewName = (v, o) => viewInfo.GetViewName != null ? viewInfo.GetViewName((TView) v, (TViewData) o) : null, + GetViewName = (v, o) => viewInfo.GetViewName?.Invoke((TView) v, (TViewData) o), CreateInstance = () => viewInfo.CreateInstance() }; } Index: Core/Common/src/Core.Common.Utils/NullableEnumConverter.cs =================================================================== diff -u -r7ac739bd142fda419737a1e3ce328f373ab3531f -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Core/Common/src/Core.Common.Utils/NullableEnumConverter.cs (.../NullableEnumConverter.cs) (revision 7ac739bd142fda419737a1e3ce328f373ab3531f) +++ Core/Common/src/Core.Common.Utils/NullableEnumConverter.cs (.../NullableEnumConverter.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -97,7 +97,7 @@ private static string GetDisplayName(MemberInfo memberInfo) { var resourcesDisplayNameAttribute = (ResourcesDisplayNameAttribute) Attribute.GetCustomAttribute(memberInfo, typeof(ResourcesDisplayNameAttribute)); - return resourcesDisplayNameAttribute != null ? resourcesDisplayNameAttribute.DisplayName : null; + return resourcesDisplayNameAttribute?.DisplayName; } } } \ No newline at end of file Index: Core/Common/test/Core.Common.Gui.Test/Forms/SplashScreen/SplashScreenTest.cs =================================================================== diff -u -rb9238c12b280f700b45fc0141ac1a2087e7ba4ba -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Core/Common/test/Core.Common.Gui.Test/Forms/SplashScreen/SplashScreenTest.cs (.../SplashScreenTest.cs) (revision b9238c12b280f700b45fc0141ac1a2087e7ba4ba) +++ Core/Common/test/Core.Common.Gui.Test/Forms/SplashScreen/SplashScreenTest.cs (.../SplashScreenTest.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -129,7 +129,7 @@ private static string GetLabelText(FrameworkElement parent, string labelName) { var label = FindControlRecursively(parent, labelName) as Label; - return label != null ? label.Content.ToString() : ""; + return label?.Content.ToString() ?? ""; } private static bool GetIsControlVisible(FrameworkElement parent, string ctrlName) Index: Core/Components/src/Core.Components.Gis.IO/Readers/ShapeFileReaderBase.cs =================================================================== diff -u -r72fae487f4d6debd3cec5157de8796827bf27a0c -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Core/Components/src/Core.Components.Gis.IO/Readers/ShapeFileReaderBase.cs (.../ShapeFileReaderBase.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) +++ Core/Components/src/Core.Components.Gis.IO/Readers/ShapeFileReaderBase.cs (.../ShapeFileReaderBase.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -68,7 +68,7 @@ /// public int GetNumberOfFeatures() { - return ShapeFile != null ? ShapeFile.Features.Count : 0; + return ShapeFile?.Features.Count ?? 0; } /// Index: Core/Components/src/Core.Components.OxyPlot.Forms/LinearPlotView.cs =================================================================== diff -u -r7ac739bd142fda419737a1e3ce328f373ab3531f -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Core/Components/src/Core.Components.OxyPlot.Forms/LinearPlotView.cs (.../LinearPlotView.cs) (revision 7ac739bd142fda419737a1e3ce328f373ab3531f) +++ Core/Components/src/Core.Components.OxyPlot.Forms/LinearPlotView.cs (.../LinearPlotView.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -77,7 +77,7 @@ get { Axis axis = GetAxisOnPosition(AxisPosition.Bottom); - return axis != null ? axis.Title : null; + return axis?.Title; } set { @@ -93,7 +93,7 @@ get { Axis axis = GetAxisOnPosition(AxisPosition.Left); - return axis != null ? axis.Title : null; + return axis?.Title; } set { Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Views/ClosingStructuresFailureMechanismResultView.cs =================================================================== diff -u -rc5505f73b4c053fbc8eb0a5e2f230e3daf3de940 -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Views/ClosingStructuresFailureMechanismResultView.cs (.../ClosingStructuresFailureMechanismResultView.cs) (revision c5505f73b4c053fbc8eb0a5e2f230e3daf3de940) +++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Views/ClosingStructuresFailureMechanismResultView.cs (.../ClosingStructuresFailureMechanismResultView.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -74,7 +74,7 @@ base.FailureMechanism = value; var calculatableFailureMechanism = value as ICalculatableFailureMechanism; - CalculationGroup observableGroup = calculatableFailureMechanism != null ? calculatableFailureMechanism.CalculationsGroup : null; + CalculationGroup observableGroup = calculatableFailureMechanism?.CalculationsGroup; calculationInputObserver.Observable = observableGroup; calculationOutputObserver.Observable = observableGroup; Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Views/ClosingStructuresScenariosView.cs =================================================================== diff -u -r72fae487f4d6debd3cec5157de8796827bf27a0c -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Views/ClosingStructuresScenariosView.cs (.../ClosingStructuresScenariosView.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) +++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Views/ClosingStructuresScenariosView.cs (.../ClosingStructuresScenariosView.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -120,7 +120,7 @@ { scenarioSelectionControl.EndEdit(); - if (failureMechanism == null || failureMechanism.SectionResults == null || data == null || data.Children == null) + if (failureMechanism?.SectionResults == null || data?.Children == null) { scenarioSelectionControl.ClearDataSource(); } Index: Ringtoets/Common/src/Ringtoets.Common.Data/Hydraulics/HydraulicBoundaryLocation.cs =================================================================== diff -u -ra25d8e273425a90e4a8fa870f5fb624f7684ef20 -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Ringtoets/Common/src/Ringtoets.Common.Data/Hydraulics/HydraulicBoundaryLocation.cs (.../HydraulicBoundaryLocation.cs) (revision a25d8e273425a90e4a8fa870f5fb624f7684ef20) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Hydraulics/HydraulicBoundaryLocation.cs (.../HydraulicBoundaryLocation.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -77,9 +77,7 @@ { get { - return DesignWaterLevelOutput == null - ? RoundedDouble.NaN - : DesignWaterLevelOutput.Result; + return DesignWaterLevelOutput?.Result ?? RoundedDouble.NaN; } } @@ -90,9 +88,7 @@ { get { - return DesignWaterLevelOutput == null - ? CalculationConvergence.NotCalculated - : DesignWaterLevelOutput.CalculationConvergence; + return DesignWaterLevelOutput?.CalculationConvergence ?? CalculationConvergence.NotCalculated; } } @@ -108,9 +104,7 @@ { get { - return WaveHeightOutput == null - ? RoundedDouble.NaN - : WaveHeightOutput.Result; + return WaveHeightOutput?.Result ?? RoundedDouble.NaN; } } @@ -121,9 +115,7 @@ { get { - return WaveHeightOutput == null - ? CalculationConvergence.NotCalculated - : WaveHeightOutput.CalculationConvergence; + return WaveHeightOutput?.CalculationConvergence ?? CalculationConvergence.NotCalculated; } } Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/CategoryTreeFolder.cs =================================================================== diff -u -ra25d8e273425a90e4a8fa870f5fb624f7684ef20 -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/CategoryTreeFolder.cs (.../CategoryTreeFolder.cs) (revision a25d8e273425a90e4a8fa870f5fb624f7684ef20) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/CategoryTreeFolder.cs (.../CategoryTreeFolder.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -80,7 +80,7 @@ public override int GetHashCode() { - return Contents.Cast().Aggregate(Name != null ? Name.GetHashCode() : 0, (current, content) => current ^ content.GetHashCode()); + return Contents.Cast().Aggregate(Name?.GetHashCode() ?? 0, (current, content) => current ^ content.GetHashCode()); } private bool Equals(CategoryTreeFolder other) Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/SelectableHydraulicBoundaryLocation.cs =================================================================== diff -u -ra1bba29ba0d84061cca88da8324957087d564db9 -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/SelectableHydraulicBoundaryLocation.cs (.../SelectableHydraulicBoundaryLocation.cs) (revision a1bba29ba0d84061cca88da8324957087d564db9) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/SelectableHydraulicBoundaryLocation.cs (.../SelectableHydraulicBoundaryLocation.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -50,9 +50,7 @@ HydraulicBoundaryLocation = hydraulicBoundaryLocation; - Distance = new RoundedDouble(0, referencePoint != null - ? referencePoint.GetEuclideanDistanceTo(hydraulicBoundaryLocation.Location) - : double.NaN); + Distance = new RoundedDouble(0, referencePoint?.GetEuclideanDistanceTo(hydraulicBoundaryLocation.Location) ?? double.NaN); } /// Index: Ringtoets/Common/src/Ringtoets.Common.Forms/TreeNodeInfos/RingtoetsContextMenuItemFactory.cs =================================================================== diff -u -r72fae487f4d6debd3cec5157de8796827bf27a0c -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Ringtoets/Common/src/Ringtoets.Common.Forms/TreeNodeInfos/RingtoetsContextMenuItemFactory.cs (.../RingtoetsContextMenuItemFactory.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/TreeNodeInfos/RingtoetsContextMenuItemFactory.cs (.../RingtoetsContextMenuItemFactory.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -367,7 +367,7 @@ private static void SetStateWithEnableFunction(T context, Func enableFunction, StrictContextMenuItem menuItem) { - string validationText = enableFunction != null ? enableFunction(context) : null; + string validationText = enableFunction?.Invoke(context); if (!string.IsNullOrEmpty(validationText)) { menuItem.Enabled = false; Index: Ringtoets/Common/src/Ringtoets.Common.Forms/UITypeEditors/HydraulicBoundaryLocationEditor.cs =================================================================== diff -u -ra1bba29ba0d84061cca88da8324957087d564db9 -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Ringtoets/Common/src/Ringtoets.Common.Forms/UITypeEditors/HydraulicBoundaryLocationEditor.cs (.../HydraulicBoundaryLocationEditor.cs) (revision a1bba29ba0d84061cca88da8324957087d564db9) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/UITypeEditors/HydraulicBoundaryLocationEditor.cs (.../HydraulicBoundaryLocationEditor.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -41,9 +41,7 @@ protected override SelectableHydraulicBoundaryLocation GetCurrentOption(ITypeDescriptorContext context) { IHasHydraulicBoundaryLocationProperty propertiesObject = GetPropertiesObject(context); - return propertiesObject != null - ? propertiesObject.SelectedHydraulicBoundaryLocation - : null; + return propertiesObject?.SelectedHydraulicBoundaryLocation; } } } \ No newline at end of file Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.IO/DuneLocationsReader.cs =================================================================== diff -u -ra1bba29ba0d84061cca88da8324957087d564db9 -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.IO/DuneLocationsReader.cs (.../DuneLocationsReader.cs) (revision a1bba29ba0d84061cca88da8324957087d564db9) +++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.IO/DuneLocationsReader.cs (.../DuneLocationsReader.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -74,7 +74,7 @@ Point2D location = locationData.MapGeometries.First().PointCollections.First().First(); object nameValue = locationData.MetaData[nameKey]; - string name = nameValue != null ? nameValue.ToString() : string.Empty; + string name = nameValue?.ToString() ?? string.Empty; int coastalAreaId = Convert.ToInt32(locationData.MetaData[coastalAreaIdKey]); double offset = Convert.ToDouble(locationData.MetaData[offsetKey]); Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/GrassCoverErosionInwardsInput.cs =================================================================== diff -u -r6afbb616ce84cccaf56617d60c5cd821b00daab0 -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/GrassCoverErosionInwardsInput.cs (.../GrassCoverErosionInwardsInput.cs) (revision 6afbb616ce84cccaf56617d60c5cd821b00daab0) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/GrassCoverErosionInwardsInput.cs (.../GrassCoverErosionInwardsInput.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -118,9 +118,7 @@ { get { - return dikeProfile != null - ? dikeProfile.DikeGeometry.ToArray() - : new RoughnessPoint[0]; + return dikeProfile?.DikeGeometry.ToArray() ?? new RoughnessPoint[0]; } } Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsChartDataFactory.cs =================================================================== diff -u -re4313e642aa3af2d1f1ced4c397c421579cfb36d -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsChartDataFactory.cs (.../GrassCoverErosionInwardsChartDataFactory.cs) (revision e4313e642aa3af2d1f1ced4c397c421579cfb36d) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsChartDataFactory.cs (.../GrassCoverErosionInwardsChartDataFactory.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -101,7 +101,7 @@ /// public static void UpdateForeshoreGeometryChartDataName(ChartLineData chartData, GrassCoverErosionInwardsInput input) { - chartData.Name = input != null && input.DikeProfile != null && input.UseForeshore + chartData.Name = input?.DikeProfile != null && input.UseForeshore ? string.Format(Resources.GrassCoverErosionInwardsChartDataFactory_Create_DataIdentifier_0_DataTypeDisplayName_1_, input.DikeProfile.Name, RingtoetsCommonFormsResources.Foreshore_DisplayName) Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsChartDataPointsFactory.cs =================================================================== diff -u -r6afbb616ce84cccaf56617d60c5cd821b00daab0 -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsChartDataPointsFactory.cs (.../GrassCoverErosionInwardsChartDataPointsFactory.cs) (revision 6afbb616ce84cccaf56617d60c5cd821b00daab0) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsChartDataPointsFactory.cs (.../GrassCoverErosionInwardsChartDataPointsFactory.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -40,9 +40,7 @@ /// An array of points in 2D space or an empty array when is null. public static Point2D[] CreateDikeGeometryPoints(DikeProfile dikeProfile) { - return dikeProfile != null - ? dikeProfile.DikeGeometry.Select(dg => dg.Point).ToArray() - : new Point2D[0]; + return dikeProfile?.DikeGeometry.Select(dg => dg.Point).ToArray() ?? new Point2D[0]; } /// @@ -58,7 +56,7 @@ /// public static Point2D[] CreateForeshoreGeometryPoints(GrassCoverErosionInwardsInput input) { - return input != null && input.DikeProfile != null && input.UseForeshore + return input?.DikeProfile != null && input.UseForeshore ? input.DikeProfile.ForeshoreGeometry.ToArray() : new Point2D[0]; } @@ -77,7 +75,7 @@ /// public static Point2D[] CreateDikeHeightPoints(GrassCoverErosionInwardsInput input) { - if (input == null || input.DikeProfile == null || double.IsNaN(input.DikeHeight) || input.DikeProfile.DikeGeometry.Length < 2) + if (input?.DikeProfile == null || double.IsNaN(input.DikeHeight) || input.DikeProfile.DikeGeometry.Length < 2) { return new Point2D[0]; } Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsFailureMechanismResultView.cs =================================================================== diff -u -rc5505f73b4c053fbc8eb0a5e2f230e3daf3de940 -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsFailureMechanismResultView.cs (.../GrassCoverErosionInwardsFailureMechanismResultView.cs) (revision c5505f73b4c053fbc8eb0a5e2f230e3daf3de940) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsFailureMechanismResultView.cs (.../GrassCoverErosionInwardsFailureMechanismResultView.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -74,7 +74,7 @@ base.FailureMechanism = value; var calculatableFailureMechanism = value as ICalculatableFailureMechanism; - CalculationGroup observableGroup = calculatableFailureMechanism != null ? calculatableFailureMechanism.CalculationsGroup : null; + CalculationGroup observableGroup = calculatableFailureMechanism?.CalculationsGroup; calculationInputObserver.Observable = observableGroup; calculationOutputObserver.Observable = observableGroup; Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsInputView.cs =================================================================== diff -u -r72fae487f4d6debd3cec5157de8796827bf27a0c -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsInputView.cs (.../GrassCoverErosionInwardsInputView.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsInputView.cs (.../GrassCoverErosionInwardsInputView.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -75,7 +75,7 @@ data = value as GrassCoverErosionInwardsCalculation; calculationObserver.Observable = data; - calculationInputObserver.Observable = data != null ? data.InputParameters : null; + calculationInputObserver.Observable = data?.InputParameters; if (data == null) { Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsScenariosView.cs =================================================================== diff -u -r72fae487f4d6debd3cec5157de8796827bf27a0c -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsScenariosView.cs (.../GrassCoverErosionInwardsScenariosView.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsScenariosView.cs (.../GrassCoverErosionInwardsScenariosView.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -119,7 +119,7 @@ { scenarioSelectionControl.EndEdit(); - if (failureMechanism == null || failureMechanism.SectionResults == null || data == null || data.Children == null) + if (failureMechanism?.SectionResults == null || data?.Children == null) { scenarioSelectionControl.ClearDataSource(); } Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsDesignWaterLevelLocationContextProperties.cs =================================================================== diff -u -r69eb8c7057601ce45297368b9281ea1e60980f28 -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsDesignWaterLevelLocationContextProperties.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationContextProperties.cs) (revision 69eb8c7057601ce45297368b9281ea1e60980f28) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsDesignWaterLevelLocationContextProperties.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationContextProperties.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -89,7 +89,7 @@ get { HydraulicBoundaryLocationOutput output = data.HydraulicBoundaryLocation.DesignWaterLevelOutput; - return output == null ? double.NaN : output.TargetProbability; + return output?.TargetProbability ?? double.NaN; } } @@ -103,7 +103,7 @@ get { HydraulicBoundaryLocationOutput output = data.HydraulicBoundaryLocation.DesignWaterLevelOutput; - return output != null ? output.TargetReliability : RoundedDouble.NaN; + return output?.TargetReliability ?? RoundedDouble.NaN; } } @@ -117,7 +117,7 @@ get { HydraulicBoundaryLocationOutput output = data.HydraulicBoundaryLocation.DesignWaterLevelOutput; - return output == null ? double.NaN : output.CalculatedProbability; + return output?.CalculatedProbability ?? double.NaN; } } @@ -131,7 +131,7 @@ get { HydraulicBoundaryLocationOutput output = data.HydraulicBoundaryLocation.DesignWaterLevelOutput; - return output != null ? output.CalculatedReliability : RoundedDouble.NaN; + return output?.CalculatedReliability ?? RoundedDouble.NaN; } } Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsWaveHeightLocationContextProperties.cs =================================================================== diff -u -r69eb8c7057601ce45297368b9281ea1e60980f28 -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsWaveHeightLocationContextProperties.cs (.../GrassCoverErosionOutwardsWaveHeightLocationContextProperties.cs) (revision 69eb8c7057601ce45297368b9281ea1e60980f28) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsWaveHeightLocationContextProperties.cs (.../GrassCoverErosionOutwardsWaveHeightLocationContextProperties.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -89,7 +89,7 @@ get { HydraulicBoundaryLocationOutput output = data.HydraulicBoundaryLocation.WaveHeightOutput; - return output == null ? double.NaN : output.TargetProbability; + return output?.TargetProbability ?? double.NaN; } } @@ -103,7 +103,7 @@ get { HydraulicBoundaryLocationOutput output = data.HydraulicBoundaryLocation.WaveHeightOutput; - return output != null ? output.TargetReliability : RoundedDouble.NaN; + return output?.TargetReliability ?? RoundedDouble.NaN; } } @@ -117,7 +117,7 @@ get { HydraulicBoundaryLocationOutput output = data.HydraulicBoundaryLocation.WaveHeightOutput; - return output == null ? double.NaN : output.CalculatedProbability; + return output?.CalculatedProbability ?? double.NaN; } } @@ -131,7 +131,7 @@ get { HydraulicBoundaryLocationOutput output = data.HydraulicBoundaryLocation.WaveHeightOutput; - return output != null ? output.CalculatedReliability : RoundedDouble.NaN; + return output?.CalculatedReliability ?? RoundedDouble.NaN; } } Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismResultView.cs =================================================================== diff -u -rc5505f73b4c053fbc8eb0a5e2f230e3daf3de940 -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismResultView.cs (.../HeightStructuresFailureMechanismResultView.cs) (revision c5505f73b4c053fbc8eb0a5e2f230e3daf3de940) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismResultView.cs (.../HeightStructuresFailureMechanismResultView.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -74,9 +74,7 @@ base.FailureMechanism = value; var calculatableFailureMechanism = value as ICalculatableFailureMechanism; - CalculationGroup observableGroup = calculatableFailureMechanism != null - ? calculatableFailureMechanism.CalculationsGroup - : null; + CalculationGroup observableGroup = calculatableFailureMechanism?.CalculationsGroup; calculationInputObserver.Observable = observableGroup; calculationOutputObserver.Observable = observableGroup; Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresScenariosView.cs =================================================================== diff -u -r72fae487f4d6debd3cec5157de8796827bf27a0c -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresScenariosView.cs (.../HeightStructuresScenariosView.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresScenariosView.cs (.../HeightStructuresScenariosView.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -120,7 +120,7 @@ { scenarioSelectionControl.EndEdit(); - if (FailureMechanism == null || FailureMechanism.SectionResults == null || data == null || data.Children == null) + if (FailureMechanism?.SectionResults == null || data?.Children == null) { scenarioSelectionControl.ClearDataSource(); } Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/DesignWaterLevelLocationContextProperties.cs =================================================================== diff -u -r69eb8c7057601ce45297368b9281ea1e60980f28 -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/DesignWaterLevelLocationContextProperties.cs (.../DesignWaterLevelLocationContextProperties.cs) (revision 69eb8c7057601ce45297368b9281ea1e60980f28) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/DesignWaterLevelLocationContextProperties.cs (.../DesignWaterLevelLocationContextProperties.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -86,9 +86,7 @@ { get { - return data.HydraulicBoundaryLocation.DesignWaterLevelOutput == null - ? double.NaN - : data.HydraulicBoundaryLocation.DesignWaterLevelOutput.TargetProbability; + return data.HydraulicBoundaryLocation.DesignWaterLevelOutput?.TargetProbability ?? double.NaN; } } @@ -101,9 +99,7 @@ { get { - return data.HydraulicBoundaryLocation.DesignWaterLevelOutput == null - ? RoundedDouble.NaN - : data.HydraulicBoundaryLocation.DesignWaterLevelOutput.TargetReliability; + return data.HydraulicBoundaryLocation.DesignWaterLevelOutput?.TargetReliability ?? RoundedDouble.NaN; } } @@ -116,9 +112,7 @@ { get { - return data.HydraulicBoundaryLocation.DesignWaterLevelOutput == null - ? double.NaN - : data.HydraulicBoundaryLocation.DesignWaterLevelOutput.CalculatedProbability; + return data.HydraulicBoundaryLocation.DesignWaterLevelOutput?.CalculatedProbability ?? double.NaN; } } @@ -131,9 +125,7 @@ { get { - return data.HydraulicBoundaryLocation.DesignWaterLevelOutput == null - ? RoundedDouble.NaN - : data.HydraulicBoundaryLocation.DesignWaterLevelOutput.CalculatedReliability; + return data.HydraulicBoundaryLocation.DesignWaterLevelOutput?.CalculatedReliability ?? RoundedDouble.NaN; } } @@ -145,9 +137,7 @@ { get { - return new EnumDisplayWrapper(data.HydraulicBoundaryLocation.DesignWaterLevelOutput == null - ? CalculationConvergence.NotCalculated - : data.HydraulicBoundaryLocation.DesignWaterLevelOutput.CalculationConvergence).DisplayName; + return new EnumDisplayWrapper(data.HydraulicBoundaryLocation.DesignWaterLevelOutput?.CalculationConvergence ?? CalculationConvergence.NotCalculated).DisplayName; } } } Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/WaveHeightLocationContextProperties.cs =================================================================== diff -u -r69eb8c7057601ce45297368b9281ea1e60980f28 -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/WaveHeightLocationContextProperties.cs (.../WaveHeightLocationContextProperties.cs) (revision 69eb8c7057601ce45297368b9281ea1e60980f28) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/WaveHeightLocationContextProperties.cs (.../WaveHeightLocationContextProperties.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -86,9 +86,7 @@ { get { - return data.HydraulicBoundaryLocation.WaveHeightOutput == null - ? double.NaN - : data.HydraulicBoundaryLocation.WaveHeightOutput.TargetProbability; + return data.HydraulicBoundaryLocation.WaveHeightOutput?.TargetProbability ?? double.NaN; } } @@ -101,9 +99,7 @@ { get { - return data.HydraulicBoundaryLocation.WaveHeightOutput == null - ? RoundedDouble.NaN - : data.HydraulicBoundaryLocation.WaveHeightOutput.TargetReliability; + return data.HydraulicBoundaryLocation.WaveHeightOutput?.TargetReliability ?? RoundedDouble.NaN; } } @@ -116,9 +112,7 @@ { get { - return data.HydraulicBoundaryLocation.WaveHeightOutput == null - ? double.NaN - : data.HydraulicBoundaryLocation.WaveHeightOutput.CalculatedProbability; + return data.HydraulicBoundaryLocation.WaveHeightOutput?.CalculatedProbability ?? double.NaN; } } @@ -131,9 +125,7 @@ { get { - return data.HydraulicBoundaryLocation.WaveHeightOutput == null - ? RoundedDouble.NaN - : data.HydraulicBoundaryLocation.WaveHeightOutput.CalculatedReliability; + return data.HydraulicBoundaryLocation.WaveHeightOutput?.CalculatedReliability ?? RoundedDouble.NaN; } } @@ -145,9 +137,7 @@ { get { - return new EnumDisplayWrapper(data.HydraulicBoundaryLocation.WaveHeightOutput == null - ? CalculationConvergence.NotCalculated - : data.HydraulicBoundaryLocation.WaveHeightOutput.CalculationConvergence).DisplayName; + return new EnumDisplayWrapper(data.HydraulicBoundaryLocation.WaveHeightOutput?.CalculationConvergence ?? CalculationConvergence.NotCalculated).DisplayName; } } } Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/ReferenceLineMetaSelectionDialog.cs =================================================================== diff -u -ra25d8e273425a90e4a8fa870f5fb624f7684ef20 -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/ReferenceLineMetaSelectionDialog.cs (.../ReferenceLineMetaSelectionDialog.cs) (revision a25d8e273425a90e4a8fa870f5fb624f7684ef20) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/ReferenceLineMetaSelectionDialog.cs (.../ReferenceLineMetaSelectionDialog.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -116,7 +116,7 @@ private ReferenceLineMetaSelectionRow GetSelectedReferenceLineMetaSelectionRow() { DataGridViewRow selectedRow = ReferenceLineMetaDataGridViewControl.CurrentRow; - return selectedRow == null ? null : (ReferenceLineMetaSelectionRow) selectedRow.DataBoundItem; + return (ReferenceLineMetaSelectionRow) selectedRow?.DataBoundItem; } private void CancelButtonOnClick(object sender, EventArgs e) Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/DerivedPipingInput.cs =================================================================== diff -u -r8b07dff41637bfd485f412ec534f2ddd7fe27c00 -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Ringtoets/Piping/src/Ringtoets.Piping.Data/DerivedPipingInput.cs (.../DerivedPipingInput.cs) (revision 8b07dff41637bfd485f412ec534f2ddd7fe27c00) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/DerivedPipingInput.cs (.../DerivedPipingInput.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -208,7 +208,7 @@ RingtoetsPipingSurfaceLine surfaceLine = input.SurfaceLine; RoundedDouble exitPointL = input.ExitPointL; - if (stochasticSoilProfile != null && stochasticSoilProfile.SoilProfile != null && surfaceLine != null && !double.IsNaN(exitPointL)) + if (stochasticSoilProfile?.SoilProfile != null && surfaceLine != null && !double.IsNaN(exitPointL)) { var thicknessTopAquiferLayer = new RoundedDouble(GetNumberOfDecimals(thicknessAquiferLayer), GetThicknessTopAquiferLayer(stochasticSoilProfile.SoilProfile, surfaceLine, exitPointL)); @@ -226,7 +226,7 @@ RingtoetsPipingSurfaceLine surfaceLine = input.SurfaceLine; RoundedDouble exitPointL = input.ExitPointL; - if (stochasticSoilProfile != null && stochasticSoilProfile.SoilProfile != null && surfaceLine != null && !double.IsNaN(exitPointL)) + if (stochasticSoilProfile?.SoilProfile != null && surfaceLine != null && !double.IsNaN(exitPointL)) { var weightedMean = new RoundedDouble(GetNumberOfDecimals(thicknessCoverageLayerDistribution), GetThicknessCoverageLayers(stochasticSoilProfile.SoilProfile, surfaceLine, exitPointL)); @@ -240,7 +240,7 @@ private void UpdateEffectiveThicknessCoverageLayerMean(LogNormalDistribution effectiveThicknessCoverageLayerDistribution) { - if (input.SurfaceLine != null && input.StochasticSoilProfile != null && input.StochasticSoilProfile.SoilProfile != null && !double.IsNaN(input.ExitPointL)) + if (input.SurfaceLine != null && input.StochasticSoilProfile?.SoilProfile != null && !double.IsNaN(input.ExitPointL)) { var weightedMean = new RoundedDouble(GetNumberOfDecimals(effectiveThicknessCoverageLayerDistribution), InputParameterCalculationService.CalculateEffectiveThicknessCoverageLayer( @@ -470,7 +470,7 @@ private PipingSoilLayer[] GetConsecutiveAquiferLayers() { RingtoetsPipingSurfaceLine surfaceLine = input.SurfaceLine; - PipingSoilProfile soilProfile = input.StochasticSoilProfile != null ? input.StochasticSoilProfile.SoilProfile : null; + PipingSoilProfile soilProfile = input.StochasticSoilProfile?.SoilProfile; RoundedDouble exitPointL = input.ExitPointL; if (surfaceLine != null && soilProfile != null && !double.IsNaN(exitPointL)) @@ -484,7 +484,7 @@ private PipingSoilLayer[] GetConsecutiveCoverageLayers() { RingtoetsPipingSurfaceLine surfaceLine = input.SurfaceLine; - PipingSoilProfile soilProfile = input.StochasticSoilProfile != null ? input.StochasticSoilProfile.SoilProfile : null; + PipingSoilProfile soilProfile = input.StochasticSoilProfile?.SoilProfile; RoundedDouble exitPointL = input.ExitPointL; if (surfaceLine != null && soilProfile != null && !double.IsNaN(exitPointL)) Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/StochasticSoilProfileProperties.cs =================================================================== diff -u -r6afbb616ce84cccaf56617d60c5cd821b00daab0 -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/StochasticSoilProfileProperties.cs (.../StochasticSoilProfileProperties.cs) (revision 6afbb616ce84cccaf56617d60c5cd821b00daab0) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/StochasticSoilProfileProperties.cs (.../StochasticSoilProfileProperties.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -74,7 +74,7 @@ { get { - return data.SoilProfile != null ? data.SoilProfile.Layers.Select(l => l.Top).ToArray() : new double[0]; + return data.SoilProfile?.Layers.Select(l => l.Top).ToArray() ?? new double[0]; } } @@ -86,7 +86,7 @@ { get { - return data.SoilProfile != null ? data.SoilProfile.Bottom : double.NaN; + return data.SoilProfile?.Bottom ?? double.NaN; } } Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingChartDataPointsFactory.cs =================================================================== diff -u -r6afbb616ce84cccaf56617d60c5cd821b00daab0 -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingChartDataPointsFactory.cs (.../PipingChartDataPointsFactory.cs) (revision 6afbb616ce84cccaf56617d60c5cd821b00daab0) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingChartDataPointsFactory.cs (.../PipingChartDataPointsFactory.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -43,9 +43,7 @@ /// An array of points in 2D space or an empty array when is null. public static Point2D[] CreateSurfaceLinePoints(RingtoetsPipingSurfaceLine surfaceLine) { - return surfaceLine != null - ? surfaceLine.ProjectGeometryToLZ().ToArray() - : new Point2D[0]; + return surfaceLine?.ProjectGeometryToLZ().ToArray() ?? new Point2D[0]; } /// @@ -61,7 +59,7 @@ /// public static Point2D[] CreateEntryPointPoint(PipingInput pipingInput) { - return pipingInput != null && pipingInput.SurfaceLine != null && !double.IsNaN(pipingInput.EntryPointL) + return pipingInput?.SurfaceLine != null && !double.IsNaN(pipingInput.EntryPointL) ? new[] { new Point2D(pipingInput.EntryPointL, pipingInput.SurfaceLine.GetZAtL(pipingInput.EntryPointL)) @@ -82,7 +80,7 @@ /// public static Point2D[] CreateExitPointPoint(PipingInput pipingInput) { - return pipingInput != null && pipingInput.SurfaceLine != null && !double.IsNaN(pipingInput.ExitPointL) + return pipingInput?.SurfaceLine != null && !double.IsNaN(pipingInput.ExitPointL) ? new[] { new Point2D(pipingInput.ExitPointL, pipingInput.SurfaceLine.GetZAtL(pipingInput.ExitPointL)) @@ -102,7 +100,7 @@ /// public static Point2D[] CreateDitchPolderSidePoint(RingtoetsPipingSurfaceLine surfaceLine) { - return surfaceLine != null && surfaceLine.DitchPolderSide != null + return surfaceLine?.DitchPolderSide != null ? new[] { surfaceLine.GetLocalPointFromGeometry(surfaceLine.DitchPolderSide) @@ -122,7 +120,7 @@ /// public static Point2D[] CreateBottomDitchPolderSidePoint(RingtoetsPipingSurfaceLine surfaceLine) { - return surfaceLine != null && surfaceLine.BottomDitchPolderSide != null + return surfaceLine?.BottomDitchPolderSide != null ? new[] { surfaceLine.GetLocalPointFromGeometry(surfaceLine.BottomDitchPolderSide) @@ -142,7 +140,7 @@ /// public static Point2D[] CreateBottomDitchDikeSidePoint(RingtoetsPipingSurfaceLine surfaceLine) { - return surfaceLine != null && surfaceLine.BottomDitchDikeSide != null + return surfaceLine?.BottomDitchDikeSide != null ? new[] { surfaceLine.GetLocalPointFromGeometry(surfaceLine.BottomDitchDikeSide) @@ -162,7 +160,7 @@ /// public static Point2D[] CreateDitchDikeSidePoint(RingtoetsPipingSurfaceLine surfaceLine) { - return surfaceLine != null && surfaceLine.DitchDikeSide != null + return surfaceLine?.DitchDikeSide != null ? new[] { surfaceLine.GetLocalPointFromGeometry(surfaceLine.DitchDikeSide) @@ -182,7 +180,7 @@ /// public static Point2D[] CreateDikeToeAtRiverPoint(RingtoetsPipingSurfaceLine surfaceLine) { - return surfaceLine != null && surfaceLine.DikeToeAtRiver != null + return surfaceLine?.DikeToeAtRiver != null ? new[] { surfaceLine.GetLocalPointFromGeometry(surfaceLine.DikeToeAtRiver) @@ -202,7 +200,7 @@ /// public static Point2D[] CreateDikeToeAtPolderPoint(RingtoetsPipingSurfaceLine surfaceLine) { - return surfaceLine != null && surfaceLine.DikeToeAtPolder != null + return surfaceLine?.DikeToeAtPolder != null ? new[] { surfaceLine.GetLocalPointFromGeometry(surfaceLine.DikeToeAtPolder) Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingFailureMechanismResultView.cs =================================================================== diff -u -r6afbb616ce84cccaf56617d60c5cd821b00daab0 -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingFailureMechanismResultView.cs (.../PipingFailureMechanismResultView.cs) (revision 6afbb616ce84cccaf56617d60c5cd821b00daab0) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingFailureMechanismResultView.cs (.../PipingFailureMechanismResultView.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -75,7 +75,7 @@ base.FailureMechanism = value; var calculatableFailureMechanism = value as ICalculatableFailureMechanism; - CalculationGroup observableGroup = calculatableFailureMechanism != null ? calculatableFailureMechanism.CalculationsGroup : null; + CalculationGroup observableGroup = calculatableFailureMechanism?.CalculationsGroup; calculationInputObserver.Observable = observableGroup; calculationOutputObserver.Observable = observableGroup; Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingInputView.cs =================================================================== diff -u -r72fae487f4d6debd3cec5157de8796827bf27a0c -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingInputView.cs (.../PipingInputView.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingInputView.cs (.../PipingInputView.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -237,9 +237,7 @@ private IList GetSoilLayers() { - return data != null && data.InputParameters.StochasticSoilProfile != null && data.InputParameters.StochasticSoilProfile.SoilProfile != null - ? data.InputParameters.StochasticSoilProfile.SoilProfile.Layers.ToList() - : new List(); + return data?.InputParameters.StochasticSoilProfile?.SoilProfile?.Layers.ToList() ?? new List(); } } } \ No newline at end of file Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Views/StabilityPointStructuresFailureMechanismResultView.cs =================================================================== diff -u -rc5505f73b4c053fbc8eb0a5e2f230e3daf3de940 -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Views/StabilityPointStructuresFailureMechanismResultView.cs (.../StabilityPointStructuresFailureMechanismResultView.cs) (revision c5505f73b4c053fbc8eb0a5e2f230e3daf3de940) +++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Views/StabilityPointStructuresFailureMechanismResultView.cs (.../StabilityPointStructuresFailureMechanismResultView.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -74,9 +74,7 @@ base.FailureMechanism = value; var calculatableFailureMechanism = value as ICalculatableFailureMechanism; - CalculationGroup observableGroup = calculatableFailureMechanism != null - ? calculatableFailureMechanism.CalculationsGroup - : null; + CalculationGroup observableGroup = calculatableFailureMechanism?.CalculationsGroup; calculationInputObserver.Observable = observableGroup; calculationOutputObserver.Observable = observableGroup; Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Views/StabilityPointStructuresScenariosView.cs =================================================================== diff -u -r72fae487f4d6debd3cec5157de8796827bf27a0c -rc50d495de60db188ded1147be4d6d64d7ea29a2a --- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Views/StabilityPointStructuresScenariosView.cs (.../StabilityPointStructuresScenariosView.cs) (revision 72fae487f4d6debd3cec5157de8796827bf27a0c) +++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Views/StabilityPointStructuresScenariosView.cs (.../StabilityPointStructuresScenariosView.cs) (revision c50d495de60db188ded1147be4d6d64d7ea29a2a) @@ -120,7 +120,7 @@ { scenarioSelectionControl.EndEdit(); - if (failureMechanism == null || failureMechanism.SectionResults == null || data == null || data.Children == null) + if (failureMechanism?.SectionResults == null || data?.Children == null) { scenarioSelectionControl.ClearDataSource(); }