Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs =================================================================== diff -u -r745102a18318529c4f35e1d6f9fcdbda997e7c8a -rb080cb9fb0858490cddf9f9f6bb043230146e4c2 --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision 745102a18318529c4f35e1d6f9fcdbda997e7c8a) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision b080cb9fb0858490cddf9f9f6bb043230146e4c2) @@ -359,7 +359,7 @@ GetViewName = (view, context) => RingtoetsFormsResources.DesignWaterLevelLocationsContext_DisplayName, GetViewData = context => context.WrappedData.HydraulicBoundaryDatabase?.Locations, Image = RingtoetsCommonFormsResources.GenericInputOutputIcon, - CloseForData = CloseDesignWaterLevelLocationsViewForData, + CloseForData = CloseHydraulicBoundaryLocationsViewForData, CreateInstance = context => new DesignWaterLevelLocationsView(context.WrappedData), AfterCreate = (view, context) => { view.CalculationGuiService = hydraulicBoundaryLocationCalculationGuiService; } }; @@ -369,7 +369,7 @@ GetViewName = (view, context) => RingtoetsFormsResources.WaveHeightLocationsContext_DisplayName, GetViewData = context => context.WrappedData.HydraulicBoundaryDatabase?.Locations, Image = RingtoetsCommonFormsResources.GenericInputOutputIcon, - CloseForData = CloseWaveHeightLocationsViewForData, + CloseForData = CloseHydraulicBoundaryLocationsViewForData, CreateInstance = context => new WaveHeightLocationsView(context.WrappedData), AfterCreate = (view, context) => { view.CalculationGuiService = hydraulicBoundaryLocationCalculationGuiService; } }; @@ -426,7 +426,7 @@ Image = RingtoetsCommonFormsResources.GenericInputOutputIcon, GetViewName = (view, context) => RingtoetsCommonFormsResources.Calculation_Input, GetViewData = context => context.Calculation, - CloseForData = CloseWaveConditionsInputViewForData, + CloseForData = CloseCalculationViewForData>, CreateInstance = context => new WaveConditionsInputView(GetWaveConditionsInputViewStyle(context)) }; @@ -435,6 +435,7 @@ Image = RingtoetsCommonFormsResources.GeneralOutputIcon, GetViewName = (view, context) => RingtoetsCommonFormsResources.CalculationOutput_DisplayName, GetViewData = context => context.WrappedData, + CloseForData = CloseCalculationViewForData, CreateInstance = context => new GeneralResultFaultTreeIllustrationPointView(() => context.WrappedData.Output?.GeneralResult) }; } @@ -914,9 +915,9 @@ #endregion - #region DesignWaterLevelLocationsView ViewInfo + #region HydraulicBoundaryLocationsView ViewInfo - private static bool CloseDesignWaterLevelLocationsViewForData(DesignWaterLevelLocationsView view, object dataToCloseFor) + private static bool CloseHydraulicBoundaryLocationsViewForData(HydraulicBoundaryLocationsView view, object dataToCloseFor) { IAssessmentSection viewData = view.AssessmentSection; var assessmentSection = dataToCloseFor as IAssessmentSection; @@ -926,18 +927,6 @@ #endregion - #region WaveHeightLocationsView ViewInfo - - private static bool CloseWaveHeightLocationsViewForData(WaveHeightLocationsView view, object dataToCloseFor) - { - IAssessmentSection viewData = view.AssessmentSection; - var assessmentSection = dataToCloseFor as IAssessmentSection; - - return assessmentSection != null && ReferenceEquals(viewData, assessmentSection); - } - - #endregion - #region Comment ViewInfo private static bool CloseCommentViewForData(CommentView commentView, object o) @@ -1029,32 +1018,34 @@ return null; } - private static bool CloseWaveConditionsInputViewForData(WaveConditionsInputView view, object o) + #endregion + + private static bool CloseCalculationViewForData(IView view, object o) where T : ICalculation { - var context = o as ICalculationContext, IFailureMechanism>; + var context = o as ICalculationContext; if (context != null) { return ReferenceEquals(view.Data, context.WrappedData); } - IEnumerable> calculations; + IEnumerable calculations; var calculationGroupContext = o as ICalculationContext; if (calculationGroupContext != null) { calculations = calculationGroupContext.WrappedData .GetCalculations() - .OfType>(); + .OfType(); } else { - calculations = GetCalculationsFromFailureMechanisms(o); + calculations = GetCalculationsFromFailureMechanisms(o); } return calculations.Any(c => ReferenceEquals(view.Data, c)); } - private static IEnumerable> GetCalculationsFromFailureMechanisms(object o) + private static IEnumerable GetCalculationsFromFailureMechanisms(object o) { var failureMechanism = o as IFailureMechanism; @@ -1066,25 +1057,22 @@ if (failureMechanism != null) { - return failureMechanism.Calculations - .OfType>(); + return failureMechanism.Calculations.OfType(); } var assessmentSection = o as IAssessmentSection; if (assessmentSection != null) { return assessmentSection.GetFailureMechanisms() .SelectMany(fm => fm.Calculations) - .OfType>(); + .OfType(); } - return Enumerable.Empty>(); + return Enumerable.Empty(); } #endregion - #endregion - #region TreeNodeInfos #region FailureMechanismSectionsContext TreeNodeInfo