Пример #1
0
        private static Attribute[] CreateAttributesArray(PropertyStoreItem item)
        {
            List <Attribute> attributeList = new List <Attribute>();

            foreach (Attribute attribute in item.Attributes)
            {
                attributeList.Add(attribute);
            }
            attributeList.Add((Attribute) new BrowsableAttribute(true));
            attributeList.Add((Attribute) new CategoryAttribute(item.Category));
            attributeList.Add((Attribute) new ReadOnlyAttribute(item.ReadOnly));
            attributeList.Add((Attribute) new DescriptionAttribute(item.Description));
            if (!string.IsNullOrEmpty(item.Label))
            {
                attributeList.Add((Attribute) new DisplayNameAttribute(item.Label));
            }
            return(attributeList.ToArray());
        }
Пример #2
0
 public PropertyStorePropertyDescriptor(PropertyStoreItem item)
     : base(item.PropertyName, PropertyStorePropertyDescriptor.CreateAttributesArray(item))
 {
     this.item = item;
 }