Index: Core/Common/src/Core.Common.Controls/Core.Common.Controls.csproj =================================================================== diff -u -r2bece99f4c12df81fb2a6854a24c0e9f4d4d3c42 -rb389b4d34dab98838a8c2f087b18cfdac544f01f --- Core/Common/src/Core.Common.Controls/Core.Common.Controls.csproj (.../Core.Common.Controls.csproj) (revision 2bece99f4c12df81fb2a6854a24c0e9f4d4d3c42) +++ Core/Common/src/Core.Common.Controls/Core.Common.Controls.csproj (.../Core.Common.Controls.csproj) (revision b389b4d34dab98838a8c2f087b18cfdac544f01f) @@ -150,7 +150,7 @@ DoubleBufferedTreeView.cs - ResXFileCodeGenerator + PublicResXFileCodeGenerator Resources.Designer.cs Designer Index: Core/Common/src/Core.Common.Controls/DataGrid/DataGridViewComboBoxItemWrapper.cs =================================================================== diff -u -r6f96b9e0a720cda453d3402f16103b27523b28a1 -rb389b4d34dab98838a8c2f087b18cfdac544f01f --- Core/Common/src/Core.Common.Controls/DataGrid/DataGridViewComboBoxItemWrapper.cs (.../DataGridViewComboBoxItemWrapper.cs) (revision 6f96b9e0a720cda453d3402f16103b27523b28a1) +++ Core/Common/src/Core.Common.Controls/DataGrid/DataGridViewComboBoxItemWrapper.cs (.../DataGridViewComboBoxItemWrapper.cs) (revision b389b4d34dab98838a8c2f087b18cfdac544f01f) @@ -21,6 +21,7 @@ using System.Collections.Generic; using System.Windows.Forms; +using Core.Common.Controls.Properties; namespace Core.Common.Controls.DataGrid { @@ -48,7 +49,7 @@ { get { - return wrappedObject == null ? string.Empty : wrappedObject.ToString(); + return wrappedObject == null ? Resources.DataGridViewComboBoxItemWrapper_DisplayName_None : wrappedObject.ToString(); } } Index: Core/Common/src/Core.Common.Controls/Properties/Resources.Designer.cs =================================================================== diff -u -rc8848af0c6f8780634dcce2013e606f090da6577 -rb389b4d34dab98838a8c2f087b18cfdac544f01f --- Core/Common/src/Core.Common.Controls/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision c8848af0c6f8780634dcce2013e606f090da6577) +++ Core/Common/src/Core.Common.Controls/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision b389b4d34dab98838a8c2f087b18cfdac544f01f) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.17929 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -22,7 +22,7 @@ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { + public class Resources { private static global::System.Resources.ResourceManager resourceMan; @@ -36,7 +36,7 @@ /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { + public static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Core.Common.Controls.Properties.Resources", typeof(Resources).Assembly); @@ -51,7 +51,7 @@ /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { + public static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } @@ -63,11 +63,20 @@ /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// - internal static System.Drawing.Icon bug__exclamation { + public static System.Drawing.Icon bug__exclamation { get { object obj = ResourceManager.GetObject("bug__exclamation", resourceCulture); return ((System.Drawing.Icon)(obj)); } } + + /// + /// Looks up a localized string similar to <geen>. + /// + public static string DataGridViewComboBoxItemWrapper_DisplayName_None { + get { + return ResourceManager.GetString("DataGridViewComboBoxItemWrapper_DisplayName_None", resourceCulture); + } + } } } Index: Core/Common/src/Core.Common.Controls/Properties/Resources.resx =================================================================== diff -u -r40fa1903d03d65aa0020127802c42294bb46ef94 -rb389b4d34dab98838a8c2f087b18cfdac544f01f --- Core/Common/src/Core.Common.Controls/Properties/Resources.resx (.../Resources.resx) (revision 40fa1903d03d65aa0020127802c42294bb46ef94) +++ Core/Common/src/Core.Common.Controls/Properties/Resources.resx (.../Resources.resx) (revision b389b4d34dab98838a8c2f087b18cfdac544f01f) @@ -121,4 +121,7 @@ ..\Resources\bug--exclamation.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + <geen> + \ No newline at end of file Index: Core/Common/test/Core.Common.Controls.Test/DataGrid/DataGridViewComboBoxItemWrapperTest.cs =================================================================== diff -u -r6f96b9e0a720cda453d3402f16103b27523b28a1 -rb389b4d34dab98838a8c2f087b18cfdac544f01f --- Core/Common/test/Core.Common.Controls.Test/DataGrid/DataGridViewComboBoxItemWrapperTest.cs (.../DataGridViewComboBoxItemWrapperTest.cs) (revision 6f96b9e0a720cda453d3402f16103b27523b28a1) +++ Core/Common/test/Core.Common.Controls.Test/DataGrid/DataGridViewComboBoxItemWrapperTest.cs (.../DataGridViewComboBoxItemWrapperTest.cs) (revision b389b4d34dab98838a8c2f087b18cfdac544f01f) @@ -31,7 +31,7 @@ var dataGridViewComboBoxItemWrapper = new DataGridViewComboBoxItemWrapper(null); // Assert - Assert.AreEqual("", dataGridViewComboBoxItemWrapper.DisplayName); + Assert.AreEqual(Properties.Resources.DataGridViewComboBoxItemWrapper_DisplayName_None, dataGridViewComboBoxItemWrapper.DisplayName); Assert.IsNull(dataGridViewComboBoxItemWrapper.WrappedObject); Assert.AreEqual(dataGridViewComboBoxItemWrapper, dataGridViewComboBoxItemWrapper.This); } Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingCalculationsView.cs =================================================================== diff -u -rfff5f023c5b150dd71f754b3c13e839596ec19a0 -rb389b4d34dab98838a8c2f087b18cfdac544f01f --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingCalculationsView.cs (.../PipingCalculationsView.cs) (revision fff5f023c5b150dd71f754b3c13e839596ec19a0) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingCalculationsView.cs (.../PipingCalculationsView.cs) (revision b389b4d34dab98838a8c2f087b18cfdac544f01f) @@ -84,11 +84,9 @@ { pipingFailureMechanism = value; - soilProfileColumn.DataSource = pipingFailureMechanism != null - ? pipingFailureMechanism.SoilProfiles - .Select(psp => new DataGridViewComboBoxItemWrapper(psp)) - .ToList() - : GetDefaultSoilProfilesDataSource(); + var pipingSoilProfiles = pipingFailureMechanism != null ? pipingFailureMechanism.SoilProfiles : null; + + soilProfileColumn.DataSource = GetSoilProfilesDataSource(pipingSoilProfiles); } } @@ -105,11 +103,11 @@ { assessmentSection = value; - hydraulicBoundaryLocationColumn.DataSource = assessmentSection != null && assessmentSection.HydraulicBoundaryDatabase != null - ? assessmentSection.HydraulicBoundaryDatabase.Locations - .Select(hbl => new DataGridViewComboBoxItemWrapper(hbl)) - .ToList() - : GetDefaultHydraulicBoundaryLocationsDataSource(); + var hydraulicBoundaryLocations = assessmentSection != null && assessmentSection.HydraulicBoundaryDatabase != null + ? assessmentSection.HydraulicBoundaryDatabase.Locations + : null; + + hydraulicBoundaryLocationColumn.DataSource = GetHydraulicBoundaryLocationsDataSource(hydraulicBoundaryLocations); } } @@ -131,7 +129,7 @@ AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells, ValueMember = "This", DisplayMember = "DisplayName", - DataSource = GetDefaultSoilProfilesDataSource() + DataSource = GetSoilProfilesDataSource() }; hydraulicBoundaryLocationColumn = new DataGridViewComboBoxColumn @@ -142,7 +140,7 @@ AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells, ValueMember = "This", DisplayMember = "DisplayName", - DataSource = GetDefaultHydraulicBoundaryLocationsDataSource() + DataSource = GetHydraulicBoundaryLocationsDataSource() }; var dampingFactorExitMeanColumn = new DataGridViewTextBoxColumn @@ -181,20 +179,34 @@ dataGridView.Columns.AddRange(nameColumn, soilProfileColumn, hydraulicBoundaryLocationColumn, dampingFactorExitMeanColumn, phreaticLevelExitMeanColumn, entryPointLColumn, exitPointLColumn); } - private static List> GetDefaultSoilProfilesDataSource() + private static List> GetSoilProfilesDataSource(IEnumerable soilProfiles = null) { - return new List> + var dataGridViewComboBoxItemWrappers = new List> { new DataGridViewComboBoxItemWrapper(null) }; + + if (soilProfiles != null) + { + dataGridViewComboBoxItemWrappers.AddRange(soilProfiles.Select(sp => new DataGridViewComboBoxItemWrapper(sp))); + } + + return dataGridViewComboBoxItemWrappers; } - private static List> GetDefaultHydraulicBoundaryLocationsDataSource() + private static List> GetHydraulicBoundaryLocationsDataSource(IEnumerable hydraulicBoundaryLocations = null) { - return new List> + var dataGridViewComboBoxItemWrappers = new List> { new DataGridViewComboBoxItemWrapper(null) }; + + if (hydraulicBoundaryLocations != null) + { + dataGridViewComboBoxItemWrappers.AddRange(hydraulicBoundaryLocations.Select(hbl => new DataGridViewComboBoxItemWrapper(hbl))); + } + + return dataGridViewComboBoxItemWrappers; } private class PipingCalculationRow