Re[2]: Сложное свойство
От: maximoff  
Дата: 27.02.07 06:04
Оценка: +1
Использовал твой код для своего компонента (IPControl: свойство для отображения IP-адреса) и в следующем методе кажется опечатка:

Сама сущность и её конвертор

...
public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
        {
            PropertyDescriptorCollection collection;
            string[]    props = new string[]{"Color", "Width"};
            collection = TypeDescriptor.GetProperties(typeof(Line), attributes);
            return collection.Sort(array); 
        }
...



Кажется array нужно заменить на props:

...
public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
        {
            PropertyDescriptorCollection collection;
            string[]    props = new string[]{"Color", "Width"};
            collection = TypeDescriptor.GetProperties(typeof(Line), attributes);
            return collection.Sort(props); 
        }
...
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.