Index: Core/Common/src/Core.Common.Gui/PropertyBag/PropertySpec.cs =================================================================== diff -u -r3a9cee919c270dd82175fd3d704e4f4ce550a38b -rf40da8c67d0dd3f771894c3683a1befa776a8514 --- Core/Common/src/Core.Common.Gui/PropertyBag/PropertySpec.cs (.../PropertySpec.cs) (revision 3a9cee919c270dd82175fd3d704e4f4ce550a38b) +++ Core/Common/src/Core.Common.Gui/PropertyBag/PropertySpec.cs (.../PropertySpec.cs) (revision f40da8c67d0dd3f771894c3683a1befa776a8514) @@ -165,15 +165,12 @@ /// such those properties will be considered not having the expandable object type converter. public bool IsNonCustomExpandableObjectProperty() { - var typeConverterClassName = propertyInfo.GetCustomAttributes(typeof(TypeConverterAttribute), false) - .OfType() - .Select(tca => tca.ConverterTypeName) - .Where(n => !string.IsNullOrEmpty(n)); - foreach (string typeName in typeConverterClassName) + var typeConverterAttribute = (TypeConverterAttribute)Attribute.GetCustomAttribute(propertyInfo, typeof(TypeConverterAttribute), true); + if (typeConverterAttribute != null) { try { - var type = Type.GetType(typeName); + var type = Type.GetType(typeConverterAttribute.ConverterTypeName); if (type != null && typeof(ExpandableObjectConverter) == type) { return true; @@ -184,7 +181,7 @@ if (e is TargetInvocationException || e is ArgumentException || e is TypeLoadException || e is FileLoadException || e is BadImageFormatException) { - log.DebugFormat("Unable to find TypeConverter of type '{0}", typeConverterClassName); + log.DebugFormat("Unable to find TypeConverter of type '{0}", typeConverterAttribute.ConverterTypeName); } else { Index: Core/Common/test/Core.Common.Gui.Test/PropertyBag/PropertySpecTest.cs =================================================================== diff -u -rce31448a066c084f755439f3e7d453bfb042b291 -rf40da8c67d0dd3f771894c3683a1befa776a8514 --- Core/Common/test/Core.Common.Gui.Test/PropertyBag/PropertySpecTest.cs (.../PropertySpecTest.cs) (revision ce31448a066c084f755439f3e7d453bfb042b291) +++ Core/Common/test/Core.Common.Gui.Test/PropertyBag/PropertySpecTest.cs (.../PropertySpecTest.cs) (revision f40da8c67d0dd3f771894c3683a1befa776a8514) @@ -359,6 +359,21 @@ Assert.False(hasExpandableObjectTypeConverter); } + [Test] + public void IsNonCustomExpandableObjectProperty_ExpandableObjectConverterInherited_ReturnTrue() + { + // Setup + var target = new InheritorSettingPropertyToNotBrowsable(); + + var propertySpec = new PropertySpec(target.GetType().GetProperty("StringPropertyWithExpandableObjectConverter")); + + // Call + var hasExpandableObjectTypeConverter = propertySpec.IsNonCustomExpandableObjectProperty(); + + // Assert + Assert.True(hasExpandableObjectTypeConverter); + } + private class ClassWithProperties { public float this[int index] @@ -392,7 +407,7 @@ public bool BoolPropertyWithAttributes { get; set; } [TypeConverter(typeof(ExpandableObjectConverter))] - public string StringPropertyWithExpandableObjectConverter { get; set; } + public virtual string StringPropertyWithExpandableObjectConverter { get; set; } [TypeConverter(typeof(CustomExpandableObjectConverter))] public string StringPropertyWithCustomExpandableObjectConverter { get; set; } @@ -413,6 +428,8 @@ { [Browsable(false)] public override string StringPropertyWithAttributes { get; set; } + + public override string StringPropertyWithExpandableObjectConverter { get; set; } } private class SomeTypeConverter : TypeConverter {}