Index: Core/Components/src/Core.Components.GraphSharp.Forms/Converters/IconToImageSourceConverter.cs =================================================================== diff -u -r7d883600b177b00b62ece3722edc207348c109ea -r402a5c2fe5e9942511addf783895742253e4a92d --- Core/Components/src/Core.Components.GraphSharp.Forms/Converters/IconToImageSourceConverter.cs (.../IconToImageSourceConverter.cs) (revision 7d883600b177b00b62ece3722edc207348c109ea) +++ Core/Components/src/Core.Components.GraphSharp.Forms/Converters/IconToImageSourceConverter.cs (.../IconToImageSourceConverter.cs) (revision 402a5c2fe5e9942511addf783895742253e4a92d) @@ -20,7 +20,6 @@ // All rights reserved. using System; -using System.Diagnostics; using System.Drawing; using System.Globalization; using System.Windows; @@ -31,16 +30,14 @@ namespace Core.Components.GraphSharp.Forms.Converters { + /// + /// Converter to change a instance to a instance. + /// public class IconToImageSourceConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { - var icon = value as Icon; - if (icon == null) - { - Trace.TraceWarning("Attempted to convert {0} instead of Icon object in IconToImageSourceConverter", value); - return null; - } + var icon = (Icon) value; ImageSource imageSource = Imaging.CreateBitmapSourceFromHIcon( icon.Handle, Index: Core/Components/test/Core.Components.GraphSharp.Forms.Test/Converters/IconToImageSourceConverterTest.cs =================================================================== diff -u -r7d883600b177b00b62ece3722edc207348c109ea -r402a5c2fe5e9942511addf783895742253e4a92d --- Core/Components/test/Core.Components.GraphSharp.Forms.Test/Converters/IconToImageSourceConverterTest.cs (.../IconToImageSourceConverterTest.cs) (revision 7d883600b177b00b62ece3722edc207348c109ea) +++ Core/Components/test/Core.Components.GraphSharp.Forms.Test/Converters/IconToImageSourceConverterTest.cs (.../IconToImageSourceConverterTest.cs) (revision 402a5c2fe5e9942511addf783895742253e4a92d) @@ -42,19 +42,6 @@ } [Test] - public void Convert_ValueNull_ReturnNull() - { - // Setup - var converter = new IconToImageSourceConverter(); - - // Call - object convertedValue = converter.Convert(null, typeof(Icon), null, CultureInfo.InvariantCulture); - - // Assert - Assert.IsNull(convertedValue); - } - - [Test] public void ConvertBack_ThrowNotSupportedException() { // Setup