Пример #1
0
        PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties(Attribute[] attributes)
        {
            // Rather than passing this function on to the default TypeDescriptor,
            // which would return the actual properties of this object, I construct
            // a list here that contains property descriptors for the elements of the
            // _properties List.

            List <BuildPropertyDescriptor> props = new List <BuildPropertyDescriptor>();

            foreach (IBuildProperty property in _properties)
            {
                List <Attribute> attrs = new List <Attribute>();

                if (property.Category != null)
                {
                    attrs.Add(new CategoryAttribute(property.Category));
                }

                BuildPropertyDescriptor pd = new BuildPropertyDescriptor(property, attrs.ToArray());
                props.Add(pd);
            }

            return(new PropertyDescriptorCollection(props.ToArray()));
        }
Пример #2
0
        PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties(Attribute[] attributes)
        {
            // Rather than passing this function on to the default TypeDescriptor,
            // which would return the actual properties of this object, I construct
            // a list here that contains property descriptors for the elements of the
            // _properties List.

            List<BuildPropertyDescriptor> props = new List<BuildPropertyDescriptor>();

            foreach (IBuildProperty property in _properties)
            {
                List<Attribute> attrs = new List<Attribute>();

                if (property.Category != null)
                    attrs.Add(new CategoryAttribute(property.Category));

                BuildPropertyDescriptor pd = new BuildPropertyDescriptor(property, attrs.ToArray());
                props.Add(pd);
            }

            return new PropertyDescriptorCollection(props.ToArray());
        }