Index: Core/Common/src/Core.Common.Gui/Converters/PngToIconConverter.cs =================================================================== diff -u -r24da3aa72ccc0776599628c9f971081694048d9a -r4c580b17f584bdfcaae96992b11f90025647ca20 --- Core/Common/src/Core.Common.Gui/Converters/PngToIconConverter.cs (.../PngToIconConverter.cs) (revision 24da3aa72ccc0776599628c9f971081694048d9a) +++ Core/Common/src/Core.Common.Gui/Converters/PngToIconConverter.cs (.../PngToIconConverter.cs) (revision 4c580b17f584bdfcaae96992b11f90025647ca20) @@ -26,6 +26,7 @@ using System.IO; using System.Windows.Data; using System.Windows.Media.Imaging; +using Core.Common.Utils.Drawing; namespace Core.Common.Gui.Converters { @@ -36,16 +37,7 @@ { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { - MemoryStream ms = new MemoryStream(); - ((Bitmap) value).Save(ms, ImageFormat.Png); - - var image = new BitmapImage(); - image.BeginInit(); - ms.Seek(0, SeekOrigin.Begin); - image.StreamSource = ms; - image.EndInit(); - - return image; + return ((Bitmap)value).AsBitmapImage(); } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) Index: Core/Common/src/Core.Common.Gui/Forms/SelectViewDialog.cs =================================================================== diff -u -rbe66e1bec38a780abb27fedea8632acf4d24a173 -r4c580b17f584bdfcaae96992b11f90025647ca20 --- Core/Common/src/Core.Common.Gui/Forms/SelectViewDialog.cs (.../SelectViewDialog.cs) (revision be66e1bec38a780abb27fedea8632acf4d24a173) +++ Core/Common/src/Core.Common.Gui/Forms/SelectViewDialog.cs (.../SelectViewDialog.cs) (revision 4c580b17f584bdfcaae96992b11f90025647ca20) @@ -45,11 +45,13 @@ InitializeComponent(); Font lbFont = listBox.Font; - var defaultItemFont = new Font(lbFont.FontFamily, lbFont.Size, FontStyle.Bold); var g = listBox.CreateGraphics(); - var itemSize = g.MeasureString("TEST", defaultItemFont); - listBox.ItemHeight = (int) itemSize.Height; + using (var defaultItemFont = new Font(lbFont.FontFamily, lbFont.Size, FontStyle.Bold)) + { + var itemSize = g.MeasureString("TEST", defaultItemFont); + listBox.ItemHeight = (int) itemSize.Height; + } } /// Index: Core/Common/src/Core.Common.Utils/Exceptions/InvalidTypeParameterException.cs =================================================================== diff -u -r49c5da81f49a23dd6e66526d264a08bf510e6963 -r4c580b17f584bdfcaae96992b11f90025647ca20 --- Core/Common/src/Core.Common.Utils/Exceptions/InvalidTypeParameterException.cs (.../InvalidTypeParameterException.cs) (revision 49c5da81f49a23dd6e66526d264a08bf510e6963) +++ Core/Common/src/Core.Common.Utils/Exceptions/InvalidTypeParameterException.cs (.../InvalidTypeParameterException.cs) (revision 4c580b17f584bdfcaae96992b11f90025647ca20) @@ -62,6 +62,16 @@ /// /// Initializes a new instance of the class + /// with a specified error message. + /// + /// The error message that explains the reason for the exception. + /// The exception that is the cause of the current exception, + /// or a null reference if no inner exception is specified. + public InvalidTypeParameterException(string message, Exception inner) + : base(message, inner) {} + + /// + /// Initializes a new instance of the class /// with a specified error message and a reference to the inner exception that is /// the cause of this exception. /// Index: Core/Common/src/Core.Common.Utils/Extensions/StringExtensions.cs =================================================================== diff -u -r2aa9661130f20e88c41dac921ffb780573dcf799 -r4c580b17f584bdfcaae96992b11f90025647ca20 --- Core/Common/src/Core.Common.Utils/Extensions/StringExtensions.cs (.../StringExtensions.cs) (revision 2aa9661130f20e88c41dac921ffb780573dcf799) +++ Core/Common/src/Core.Common.Utils/Extensions/StringExtensions.cs (.../StringExtensions.cs) (revision 4c580b17f584bdfcaae96992b11f90025647ca20) @@ -56,10 +56,10 @@ if (str.Length > 1) { - return char.ToUpper(str[0]) + str.Substring(1); + return char.ToUpper(str[0], CultureInfo.CurrentCulture) + str.Substring(1); } - return str.ToUpper(); + return str.ToUpper(CultureInfo.CurrentCulture); } /// @@ -76,10 +76,10 @@ if (str.Length > 1) { - return char.ToLower(str[0]) + str.Substring(1); + return char.ToLower(str[0], CultureInfo.CurrentCulture) + str.Substring(1); } - return str.ToLower(); + return str.ToLower(CultureInfo.CurrentCulture); } } } \ No newline at end of file Index: Core/Common/src/Core.Common.Utils/Reflection/TypeUtils.cs =================================================================== diff -u -r0df7cded06f5afbac08b97e025242ba55c90ec57 -r4c580b17f584bdfcaae96992b11f90025647ca20 --- Core/Common/src/Core.Common.Utils/Reflection/TypeUtils.cs (.../TypeUtils.cs) (revision 0df7cded06f5afbac08b97e025242ba55c90ec57) +++ Core/Common/src/Core.Common.Utils/Reflection/TypeUtils.cs (.../TypeUtils.cs) (revision 4c580b17f584bdfcaae96992b11f90025647ca20) @@ -333,7 +333,7 @@ { return GetMemberNameFromExpression(unary.Operand); } - throw new ArgumentException(); + throw new ArgumentException("expression"); } /// Index: Core/Common/test/Core.Common.Utils.Test/Exceptions/InvalidTypeParameterExceptionTest.cs =================================================================== diff -u -r49c5da81f49a23dd6e66526d264a08bf510e6963 -r4c580b17f584bdfcaae96992b11f90025647ca20 --- Core/Common/test/Core.Common.Utils.Test/Exceptions/InvalidTypeParameterExceptionTest.cs (.../InvalidTypeParameterExceptionTest.cs) (revision 49c5da81f49a23dd6e66526d264a08bf510e6963) +++ Core/Common/test/Core.Common.Utils.Test/Exceptions/InvalidTypeParameterExceptionTest.cs (.../InvalidTypeParameterExceptionTest.cs) (revision 4c580b17f584bdfcaae96992b11f90025647ca20) @@ -95,6 +95,29 @@ } [Test] + public void MessageAndInnerExceptionConstructor_ExpectedValues() + { + // Setup + var innerException = new Exception(); + const string messageText = ""; + + // Call + var exception = new InvalidTypeParameterException(messageText, innerException); + + // Assert + Assert.IsInstanceOf(exception); + Assert.AreEqual(messageText, exception.Message); + Assert.IsNull(exception.TypeParamName); + Assert.AreEqual(0, exception.Data.Count); + Assert.AreEqual(exception.TypeParamName, exception.Data["TypeParamName"]); + Assert.IsNull(exception.HelpLink); + Assert.AreEqual(innerException, exception.InnerException); + Assert.IsNull(exception.Source); + Assert.IsNull(exception.StackTrace); + Assert.IsNull(exception.TargetSite); + } + + [Test] public void TypeParameterAndMessageAndInnerExceptionConstructor_ExpectedValues() { // Setup Index: Core/Components/src/Core.Components.OxyPlot/DataSeries/ItemBasedChartDataSeriesFactory.cs =================================================================== diff -u -r4dbfc20ef0200e34db43efeb8899d72e4046cc5b -r4c580b17f584bdfcaae96992b11f90025647ca20 --- Core/Components/src/Core.Components.OxyPlot/DataSeries/ItemBasedChartDataSeriesFactory.cs (.../ItemBasedChartDataSeriesFactory.cs) (revision 4dbfc20ef0200e34db43efeb8899d72e4046cc5b) +++ Core/Components/src/Core.Components.OxyPlot/DataSeries/ItemBasedChartDataSeriesFactory.cs (.../ItemBasedChartDataSeriesFactory.cs) (revision 4c580b17f584bdfcaae96992b11f90025647ca20) @@ -20,6 +20,7 @@ // All rights reserved. using System; +using System.Globalization; using Core.Components.Charting.Data; namespace Core.Components.OxyPlot.DataSeries @@ -34,9 +35,15 @@ /// /// The to create a from. /// A instance. + /// Thrown when the given is null. /// Thrown when the given type is not supported. public static IItemBasedChartDataSeries Create(ItemBasedChartData data) { + if (data == null) + { + throw new ArgumentNullException("data"); + } + var chartPointData = data as ChartPointData; if (chartPointData != null) { @@ -61,7 +68,7 @@ return new ChartMultipleAreaDataSeries(chartMultipleAreaData); } - throw new NotSupportedException(string.Format("ItemBasedChartData of type {0} is not supported.", data.GetType().Name)); + throw new NotSupportedException(string.Format(CultureInfo.CurrentCulture, "ItemBasedChartData of type {0} is not supported.", data.GetType().Name)); } } } \ No newline at end of file Index: Core/Components/test/Core.Components.OxyPlot.Test/DataSeries/ItemBasedChartDataSeriesFactoryTest.cs =================================================================== diff -u -r4dbfc20ef0200e34db43efeb8899d72e4046cc5b -r4c580b17f584bdfcaae96992b11f90025647ca20 --- Core/Components/test/Core.Components.OxyPlot.Test/DataSeries/ItemBasedChartDataSeriesFactoryTest.cs (.../ItemBasedChartDataSeriesFactoryTest.cs) (revision 4dbfc20ef0200e34db43efeb8899d72e4046cc5b) +++ Core/Components/test/Core.Components.OxyPlot.Test/DataSeries/ItemBasedChartDataSeriesFactoryTest.cs (.../ItemBasedChartDataSeriesFactoryTest.cs) (revision 4c580b17f584bdfcaae96992b11f90025647ca20) @@ -82,6 +82,16 @@ Assert.Throws(test); } + [Test] + public void Create_NullData_ThrownsArgumentNullException() + { + // Call + TestDelegate test = () => ItemBasedChartDataSeriesFactory.Create(null); + + // Assert + Assert.Throws(test); + } + private class TestItemBasedChartData : ItemBasedChartData { public TestItemBasedChartData(string name) : base(name) {} Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Views/ClosingStructuresFailureMechanismView.cs =================================================================== diff -u -r2cafb330e0b90d1103bc9329eafbcba24836787f -r4c580b17f584bdfcaae96992b11f90025647ca20 --- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Views/ClosingStructuresFailureMechanismView.cs (.../ClosingStructuresFailureMechanismView.cs) (revision 2cafb330e0b90d1103bc9329eafbcba24836787f) +++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Views/ClosingStructuresFailureMechanismView.cs (.../ClosingStructuresFailureMechanismView.cs) (revision 4c580b17f584bdfcaae96992b11f90025647ca20) @@ -169,6 +169,7 @@ calculationInputObserver.Dispose(); calculationGroupObserver.Dispose(); calculationObserver.Dispose(); + structuresObserver.Dispose(); if (disposing && (components != null)) { Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismView.cs =================================================================== diff -u -r2cafb330e0b90d1103bc9329eafbcba24836787f -r4c580b17f584bdfcaae96992b11f90025647ca20 --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismView.cs (.../HeightStructuresFailureMechanismView.cs) (revision 2cafb330e0b90d1103bc9329eafbcba24836787f) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismView.cs (.../HeightStructuresFailureMechanismView.cs) (revision 4c580b17f584bdfcaae96992b11f90025647ca20) @@ -170,6 +170,7 @@ calculationInputObserver.Dispose(); calculationGroupObserver.Dispose(); calculationObserver.Dispose(); + structuresObserver.Dispose(); if (disposing && (components != null)) { Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Views/StabilityPointStructuresFailureMechanismView.cs =================================================================== diff -u -r2cafb330e0b90d1103bc9329eafbcba24836787f -r4c580b17f584bdfcaae96992b11f90025647ca20 --- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Views/StabilityPointStructuresFailureMechanismView.cs (.../StabilityPointStructuresFailureMechanismView.cs) (revision 2cafb330e0b90d1103bc9329eafbcba24836787f) +++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Views/StabilityPointStructuresFailureMechanismView.cs (.../StabilityPointStructuresFailureMechanismView.cs) (revision 4c580b17f584bdfcaae96992b11f90025647ca20) @@ -169,6 +169,7 @@ calculationInputObserver.Dispose(); calculationGroupObserver.Dispose(); calculationObserver.Dispose(); + structuresObserver.Dispose(); if (disposing && (components != null)) {