Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs =================================================================== diff -u -r51ddda3656dd349582d7790169a34080d79da68a -r67823f50a5a4e994c13dac0269fb61e8783efead --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision 51ddda3656dd349582d7790169a34080d79da68a) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision 67823f50a5a4e994c13dac0269fb61e8783efead) @@ -576,19 +576,13 @@ { Text = designWaterLevel => RingtoetsFormsResources.DesignWaterLevelLocationsContext_DisplayName, Image = designWaterLevel => RingtoetsCommonFormsResources.GenericInputOutputIcon, - ForeColor = context => context.WrappedData.HydraulicBoundaryDatabase == null ? - Color.FromKnownColor(KnownColor.GrayText) : - Color.FromKnownColor(KnownColor.ControlText), ContextMenuStrip = DesignWaterLevelLocationsContextMenuStrip }; yield return new TreeNodeInfo { Text = waveHeight => RingtoetsFormsResources.WaveHeightLocationsContext_DisplayName, Image = waveHeight => RingtoetsCommonFormsResources.GenericInputOutputIcon, - ForeColor = context => context.WrappedData.HydraulicBoundaryDatabase == null ? - Color.FromKnownColor(KnownColor.GrayText) : - Color.FromKnownColor(KnownColor.ControlText), ContextMenuStrip = WaveHeightLocationsContextMenuStrip }; @@ -765,7 +759,7 @@ #region FailureMechanismView ViewInfo - private bool CloseFailureMechanismViewForData(FailureMechanismView view, object o) + private static bool CloseFailureMechanismViewForData(FailureMechanismView view, object o) { var assessmentSection = o as IAssessmentSection; var failureMechanism = o as IFailureMechanism; @@ -879,7 +873,7 @@ #region ForeshoreProfile TreeNodeInfo - private bool CanRemoveForeshoreProfile(ForeshoreProfile nodeData, object parentNodeData) + private static bool CanRemoveForeshoreProfile(ForeshoreProfile nodeData, object parentNodeData) { var parentContext = (ForeshoreProfilesContext) parentNodeData; IFailureMechanism failureMechanism = parentContext.ParentFailureMechanism; @@ -891,7 +885,7 @@ failureMechanism is StabilityPointStructuresFailureMechanism; } - private void OnForeshoreProfileRemoved(ForeshoreProfile nodeData, object parentNodeData) + private static void OnForeshoreProfileRemoved(ForeshoreProfile nodeData, object parentNodeData) { var parentContext = (ForeshoreProfilesContext) parentNodeData; IFailureMechanism failureMechanism = parentContext.ParentFailureMechanism; @@ -956,12 +950,12 @@ #region DikeProfile TreeNodeInfo - private bool CanRemoveDikeProfile(DikeProfile nodeData, object parentData) + private static bool CanRemoveDikeProfile(DikeProfile nodeData, object parentData) { return parentData is DikeProfilesContext; } - private void OnDikeProfileRemoved(DikeProfile nodeData, object parentData) + private static void OnDikeProfileRemoved(DikeProfile nodeData, object parentData) { var parentContext = (DikeProfilesContext) parentData; var changedObservables = RingtoetsDataSynchronizationService.RemoveDikeProfile(parentContext.ParentFailureMechanism, @@ -1486,7 +1480,7 @@ BaseResources.Confirm, MessageBoxButtons.OKCancel); - return (confirmation == DialogResult.OK); + return confirmation == DialogResult.OK; } private static void ClearCalculations(IAssessmentSection nodeData) Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/DesignWaterLevelLocationsContextTreeNodeInfoTest.cs =================================================================== diff -u -re98196d2643883a44bc503eae24b005474983074 -r67823f50a5a4e994c13dac0269fb61e8783efead --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/DesignWaterLevelLocationsContextTreeNodeInfoTest.cs (.../DesignWaterLevelLocationsContextTreeNodeInfoTest.cs) (revision e98196d2643883a44bc503eae24b005474983074) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/DesignWaterLevelLocationsContextTreeNodeInfoTest.cs (.../DesignWaterLevelLocationsContextTreeNodeInfoTest.cs) (revision 67823f50a5a4e994c13dac0269fb61e8783efead) @@ -20,7 +20,6 @@ // All rights reserved. using System; -using System.Drawing; using System.IO; using System.Linq; using System.Threading; @@ -69,7 +68,7 @@ // Assert Assert.IsNotNull(info.Text); - Assert.IsNotNull(info.ForeColor); + Assert.IsNull(info.ForeColor); Assert.IsNotNull(info.Image); Assert.IsNotNull(info.ContextMenuStrip); Assert.IsNull(info.EnsureVisibleOnCreate); @@ -375,51 +374,6 @@ mockRepository.VerifyAll(); } - [Test] - public void ForeColor_ContextHasNoHydraulicBoundaryDatabase_ReturnDisabledColor() - { - // Setup - var assessmentSectionMock = mockRepository.Stub(); - mockRepository.ReplayAll(); - - var context = new DesignWaterLevelLocationsContext(assessmentSectionMock); - - using (var plugin = new RingtoetsPlugin()) - { - TreeNodeInfo info = GetInfo(plugin); - - // Call - Color color = info.ForeColor(context); - - // Assert - Assert.AreEqual(Color.FromKnownColor(KnownColor.GrayText), color); - } - mockRepository.VerifyAll(); - } - - [Test] - public void ForeColor_ContextHasHydraulicBoundaryDatabase_ReturnControlColor() - { - // Setup - var assessmentSectionMock = mockRepository.Stub(); - assessmentSectionMock.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); - mockRepository.ReplayAll(); - - var context = new DesignWaterLevelLocationsContext(assessmentSectionMock); - - using (var plugin = new RingtoetsPlugin()) - { - TreeNodeInfo info = GetInfo(plugin); - - // Call - Color color = info.ForeColor(context); - - // Assert - Assert.AreEqual(Color.FromKnownColor(KnownColor.ControlText), color); - } - mockRepository.VerifyAll(); - } - private static TreeNodeInfo GetInfo(RingtoetsPlugin plugin) { return plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(DesignWaterLevelLocationsContext)); Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/WaveHeightLocationsContextTreeNodeInfoTest.cs =================================================================== diff -u -re98196d2643883a44bc503eae24b005474983074 -r67823f50a5a4e994c13dac0269fb61e8783efead --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/WaveHeightLocationsContextTreeNodeInfoTest.cs (.../WaveHeightLocationsContextTreeNodeInfoTest.cs) (revision e98196d2643883a44bc503eae24b005474983074) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/WaveHeightLocationsContextTreeNodeInfoTest.cs (.../WaveHeightLocationsContextTreeNodeInfoTest.cs) (revision 67823f50a5a4e994c13dac0269fb61e8783efead) @@ -70,7 +70,7 @@ // Assert Assert.IsNotNull(info.Text); - Assert.IsNotNull(info.ForeColor); + Assert.IsNull(info.ForeColor); Assert.IsNotNull(info.Image); Assert.IsNotNull(info.ContextMenuStrip); Assert.IsNull(info.EnsureVisibleOnCreate); @@ -245,51 +245,6 @@ } [Test] - public void ForeColor_ContextHasNoHydraulicBoundaryDatabase_ReturnDisabledColor() - { - // Setup - var assessmentSectionMock = mockRepository.Stub(); - mockRepository.ReplayAll(); - - var context = new WaveHeightLocationsContext(assessmentSectionMock); - - using (var plugin = new RingtoetsPlugin()) - { - TreeNodeInfo info = GetInfo(plugin); - - // Call - Color color = info.ForeColor(context); - - // Assert - Assert.AreEqual(Color.FromKnownColor(KnownColor.GrayText), color); - } - mockRepository.VerifyAll(); - } - - [Test] - public void ForeColor_ContextHasHydraulicBoundaryDatabase_ReturnControlColor() - { - // Setup - var assessmentSectionMock = mockRepository.Stub(); - assessmentSectionMock.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); - mockRepository.ReplayAll(); - - var context = new WaveHeightLocationsContext(assessmentSectionMock); - - using (var plugin = new RingtoetsPlugin()) - { - TreeNodeInfo info = GetInfo(plugin); - - // Call - Color color = info.ForeColor(context); - - // Assert - Assert.AreEqual(Color.FromKnownColor(KnownColor.ControlText), color); - } - mockRepository.VerifyAll(); - } - - [Test] [Apartment(ApartmentState.STA)] public void GivenHydraulicBoundaryDatabaseWithNonExistingFilePath_WhenCalculatingWaveHeightFromContextMenu_ThenLogMessagesAddedPreviousOutputNotAffected() {