Index: Core/Common/src/Core.Common.Controls/DataGrid/DataGridViewControl.cs =================================================================== diff -u -rda577499419a07035258244851712e75048f3e2f -rf72f906a6875250a4378945ce814997ff8aaf1a7 --- Core/Common/src/Core.Common.Controls/DataGrid/DataGridViewControl.cs (.../DataGridViewControl.cs) (revision da577499419a07035258244851712e75048f3e2f) +++ Core/Common/src/Core.Common.Controls/DataGrid/DataGridViewControl.cs (.../DataGridViewControl.cs) (revision f72f906a6875250a4378945ce814997ff8aaf1a7) @@ -99,7 +99,7 @@ /// The of the column. /// is also used to create the . /// The format is "column_. - public void AddComboBoxColumn(string dataPropertyName, string headerText, List dataSource, string valueMember, string displayMember) + public void AddComboBoxColumn(string dataPropertyName, string headerText, IEnumerable dataSource, string valueMember, string displayMember) { var dataGridViewComboBoxColumn = new DataGridViewComboBoxColumn { Index: Core/Common/src/Core.Common.Utils/Properties/Resources.Designer.cs =================================================================== diff -u -rea99af5c043eadf5c2ba83b82a847ae009181191 -rf72f906a6875250a4378945ce814997ff8aaf1a7 --- Core/Common/src/Core.Common.Utils/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision ea99af5c043eadf5c2ba83b82a847ae009181191) +++ Core/Common/src/Core.Common.Utils/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision f72f906a6875250a4378945ce814997ff8aaf1a7) @@ -158,15 +158,5 @@ return ResourceManager.GetString("TypeUtils_GetMemberName_0_is_not_a_valid_expression_for_this_method", resourceCulture); } } - - /// - /// Looks up a localized string similar to Parameter 'member' is geen geldige expressie voor deze methode.. - /// - public static string TypeUtils_GetMemberNameFromMemberExpression_member_not_a_valid_expression_for_this_method { - get { - return ResourceManager.GetString("TypeUtils_GetMemberNameFromMemberExpression_member_not_a_valid_expression_for_thi" + - "s_method", resourceCulture); - } - } } } Index: Core/Common/src/Core.Common.Utils/Properties/Resources.resx =================================================================== diff -u -r38916623f1906041a5309d5241f7672020d69b35 -rf72f906a6875250a4378945ce814997ff8aaf1a7 --- Core/Common/src/Core.Common.Utils/Properties/Resources.resx (.../Resources.resx) (revision 38916623f1906041a5309d5241f7672020d69b35) +++ Core/Common/src/Core.Common.Utils/Properties/Resources.resx (.../Resources.resx) (revision f72f906a6875250a4378945ce814997ff8aaf1a7) @@ -138,9 +138,6 @@ Bestandspad mag niet naar een map verwijzen. - - Parameter 'member' is geen geldige expressie voor deze methode. - '{0}' is geen geldige expressie voor deze methode. Index: Core/Common/src/Core.Common.Utils/Reflection/TypeUtils.cs =================================================================== diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -rf72f906a6875250a4378945ce814997ff8aaf1a7 --- Core/Common/src/Core.Common.Utils/Reflection/TypeUtils.cs (.../TypeUtils.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71) +++ Core/Common/src/Core.Common.Utils/Reflection/TypeUtils.cs (.../TypeUtils.cs) (revision f72f906a6875250a4378945ce814997ff8aaf1a7) @@ -67,23 +67,35 @@ /// is not an expression with a member, such as a expression calling multiple methods. public static string GetMemberName(Expression> expression) { - var member = expression.Body as MemberExpression; + return GetMemberName(expression, expression.Body); + } - if (member != null) + /// + /// Gets the name of the member. + /// + /// The type of the class on which the expression takes place. + /// The expression. + /// The string name of the member. + /// When + /// is not an expression with a member, such as a expression calling multiple methods. + public static string GetMemberName(Expression> expression) + { + return GetMemberName(expression, expression.Body); + } + + private static string GetMemberName(Expression originalExpression, Expression expressionBody) + { + try { - return GetMemberNameFromMemberExpression(member); + return GetMemberNameFromExpression(expressionBody); } - - var unary = expression.Body as UnaryExpression; - - if (unary != null) + catch (ArgumentException) { - return GetMemberNameFromMemberExpression(unary.Operand as MemberExpression); + var message = string.Format(Resources.TypeUtils_GetMemberName_0_is_not_a_valid_expression_for_this_method, + originalExpression); + throw new ArgumentException(message); } - - var message = string.Format(Resources.TypeUtils_GetMemberName_0_is_not_a_valid_expression_for_this_method, - expression); - throw new ArgumentException(message); + } /// @@ -214,13 +226,38 @@ propertyInfo.SetValue(instance, value, null); } - private static string GetMemberNameFromMemberExpression(MemberExpression member) + /// + /// Returns the member name from the given . + /// + /// + /// + /// Thrown when the expression is not any of the following: + /// + /// + /// + /// with a of type + /// or . + /// + private static string GetMemberNameFromExpression(Expression expression) { + var member = expression as MemberExpression; if (member != null) { return member.Member.Name; } - throw new ArgumentException(Resources.TypeUtils_GetMemberNameFromMemberExpression_member_not_a_valid_expression_for_this_method); + + var method = expression as MethodCallExpression; + if (method != null) + { + return method.Method.Name; + } + + var unary = expression as UnaryExpression; + if (unary != null) + { + return GetMemberNameFromExpression(unary.Operand); + } + throw new ArgumentException(); } /// Index: Core/Common/test/Core.Common.Controls.Test/DataGrid/DataGridViewControlTest.cs =================================================================== diff -u -rda577499419a07035258244851712e75048f3e2f -rf72f906a6875250a4378945ce814997ff8aaf1a7 --- Core/Common/test/Core.Common.Controls.Test/DataGrid/DataGridViewControlTest.cs (.../DataGridViewControlTest.cs) (revision da577499419a07035258244851712e75048f3e2f) +++ Core/Common/test/Core.Common.Controls.Test/DataGrid/DataGridViewControlTest.cs (.../DataGridViewControlTest.cs) (revision f72f906a6875250a4378945ce814997ff8aaf1a7) @@ -276,8 +276,9 @@ propertyName, headerText, dataSource, - TypeUtils.GetMemberName((Expression, object>>) (ds => ds.Value)), - TypeUtils.GetMemberName((Expression, object>>) (ds => ds.DisplayName))); + TypeUtils.GetMemberName>(ds => ds.Value), + TypeUtils.GetMemberName>(ds => ds.DisplayName) + ); // Assert Assert.AreEqual(1, dataGridView.ColumnCount); Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Views/FailureMechanismResultView.cs =================================================================== diff -u -rd65d6b037600ccd69f386d9164172dd2c133356e -rf72f906a6875250a4378945ce814997ff8aaf1a7 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Views/FailureMechanismResultView.cs (.../FailureMechanismResultView.cs) (revision d65d6b037600ccd69f386d9164172dd2c133356e) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Views/FailureMechanismResultView.cs (.../FailureMechanismResultView.cs) (revision f72f906a6875250a4378945ce814997ff8aaf1a7) @@ -34,6 +34,7 @@ /// /// The view for the . /// + /// The type of results which are presented by the . public abstract partial class FailureMechanismResultView : UserControl, IView where T : FailureMechanismSectionResult { private const int assessmentLayerOneColumnIndex = 1; Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsFailureMechanismResultView.cs =================================================================== diff -u -rce8424c77c708edc0bb2150a9a6a0e75dad629fa -rf72f906a6875250a4378945ce814997ff8aaf1a7 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsFailureMechanismResultView.cs (.../GrassCoverErosionInwardsFailureMechanismResultView.cs) (revision ce8424c77c708edc0bb2150a9a6a0e75dad629fa) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsFailureMechanismResultView.cs (.../GrassCoverErosionInwardsFailureMechanismResultView.cs) (revision f72f906a6875250a4378945ce814997ff8aaf1a7) @@ -51,9 +51,26 @@ DataGridViewControl.AddCellFormattingHandler(DisableIrrelevantFieldsFormatting); // The concat is needed to observe the input of calculations in child groups. - calculationInputObserver = new RecursiveObserver(UpdataDataGridViewDataSource, cg => cg.Children.Concat(cg.Children.OfType().Select(c => c.GetObservableInput()))); - calculationOutputObserver = new RecursiveObserver(UpdataDataGridViewDataSource, cg => cg.Children.Concat(cg.Children.OfType().Select(c => c.GetObservableOutput()))); - calculationGroupObserver = new RecursiveObserver(UpdataDataGridViewDataSource, c => c.Children); + calculationInputObserver = new RecursiveObserver( + UpdataDataGridViewDataSource, + cg => cg.Children.Concat( + cg.Children + .OfType() + .Select(c => c.GetObservableInput()) + ) + ); + calculationOutputObserver = new RecursiveObserver( + UpdataDataGridViewDataSource, + cg => cg.Children.Concat( + cg.Children + .OfType() + .Select(c => c.GetObservableOutput()) + ) + ); + calculationGroupObserver = new RecursiveObserver( + UpdataDataGridViewDataSource, + c => c.Children + ); AddDataGridColumns(); } Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismResultView.cs =================================================================== diff -u -rce8424c77c708edc0bb2150a9a6a0e75dad629fa -rf72f906a6875250a4378945ce814997ff8aaf1a7 --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismResultView.cs (.../HeightStructuresFailureMechanismResultView.cs) (revision ce8424c77c708edc0bb2150a9a6a0e75dad629fa) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismResultView.cs (.../HeightStructuresFailureMechanismResultView.cs) (revision f72f906a6875250a4378945ce814997ff8aaf1a7) @@ -50,9 +50,26 @@ DataGridViewControl.AddCellFormattingHandler(DisableIrrelevantFieldsFormatting); // The concat is needed to observe the input of calculations in child groups. - calculationInputObserver = new RecursiveObserver(UpdataDataGridViewDataSource, cg => cg.Children.Concat(cg.Children.OfType().Select(c => c.GetObservableInput()))); - calculationOutputObserver = new RecursiveObserver(UpdataDataGridViewDataSource, cg => cg.Children.Concat(cg.Children.OfType().Select(c => c.GetObservableOutput()))); - calculationGroupObserver = new RecursiveObserver(UpdataDataGridViewDataSource, c => c.Children); + calculationInputObserver = new RecursiveObserver( + UpdataDataGridViewDataSource, + cg => cg.Children.Concat( + cg.Children + .OfType() + .Select(c => c.GetObservableInput()) + ) + ); + calculationOutputObserver = new RecursiveObserver( + UpdataDataGridViewDataSource, + cg => cg.Children.Concat( + cg.Children + .OfType() + .Select(c => c.GetObservableOutput()) + ) + ); + calculationGroupObserver = new RecursiveObserver( + UpdataDataGridViewDataSource, + c => c.Children + ); AddDataGridColumns(); } Index: Ringtoets/Integration/src/Ringtoets.Integration.Data/Ringtoets.Integration.Data.csproj =================================================================== diff -u -r08a279166007321b0ae0f2f15a2f13c191952e1b -rf72f906a6875250a4378945ce814997ff8aaf1a7 --- Ringtoets/Integration/src/Ringtoets.Integration.Data/Ringtoets.Integration.Data.csproj (.../Ringtoets.Integration.Data.csproj) (revision 08a279166007321b0ae0f2f15a2f13c191952e1b) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/Ringtoets.Integration.Data.csproj (.../Ringtoets.Integration.Data.csproj) (revision f72f906a6875250a4378945ce814997ff8aaf1a7) @@ -43,21 +43,21 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -136,7 +136,6 @@ Copying.licenseheader -