Пример #1
0
 internal CollectionPropertyItem(TCollection propertyObject, TItem item, int index, CollectionItemPropertyDescriptor <TCollection, TItem> propertyDescriptor, PropertyItem parentItem) : base(parentItem)
 {
     PropertyObject     = propertyObject;
     PropertyDescriptor = propertyDescriptor;
     _value             = item;
     Index = index;
 }
Пример #2
0
        public CollectionPropertyInfoDescriptor(PropertyInfo propertyInfo, PropertyDescriptorProvider provider) : base(provider)
        {
            PropertyInfo = propertyInfo;

            IsReadOnly  = propertyInfo.CanWrite == false;
            Name        = PropertyInfoDescriptor.GetName(propertyInfo, provider);
            DisplayName = PropertyInfoDescriptor.GetDescription(propertyInfo, provider);
            Category    = PropertyInfoDescriptor.GetCategory(propertyInfo, provider);
            Description = PropertyInfoDescriptor.GetDescription(propertyInfo, provider);

            ItemPropertyDescriptor = new CollectionItemPropertyDescriptor <TCollection, TItem>(provider);

            _getter = PropertyInfoDescriptor.CreatePropertyGetter <TTarget, TCollection>(propertyInfo);
            _setter = propertyInfo.CanWrite ? PropertyInfoDescriptor.CreatePropertySetter <TTarget, TCollection>(propertyInfo) : null;
        }