Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

IList in PropertiesWindow display Count ?

$
0
0

I developed VSPackage and want to display object in Properties window, everything works fine except for IList<T> list data type. Other class type not a collection works as expected, except this data show Count property only, even I already put TypeConverterAttribute on this class.  It seems Visual Studio ignore my converter.

Here is the example :

If I show AList in VSPackage selection track, it will show this object in Properties window with Count property only, and that is not what I expected.

BUT if I show B type which have property return AList type, this property will use AListTypeConverter and show data as expected.

The question is why when I want to show any class inherited from IList<T> or ICollection<T> , Properties window does not read TypeConverterAttribute ?

class AListTypeConverter : TypeConverter
{
     public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
        {
              //.... return my - PropertyDescriptorCollection
        }
}
[TypeConverte(typeof(AListTypeConverter))]
class AList : IList<A> {}

class B
{
     AList AList {get; set;}

}


It's hard to be advanced programmer


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>