Exemplo n.º 1
0
        public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
        {
            PropertyDescriptorCollection ps  = TypeDescriptor.GetProperties(this, attributes, true);
            List <PropertyDescriptor>    lst = new List <PropertyDescriptor>();

            foreach (PropertyDescriptor p in ps)
            {
                if (_propertyNames.Contains(p.Name))
                {
                    if (string.CompareOrdinal(p.Name, "Controls") == 0)
                    {
                        List <Attribute> al = new List <Attribute>();
                        if (p.Attributes != null)
                        {
                            foreach (Attribute a in p.Attributes)
                            {
                                al.Add(a);
                            }
                        }
                        al.Add(new NotForProgrammingAttribute());
                        lst.Add(new PropertyDescriptorWrapper(p, this, al.ToArray()));
                    }
                    else
                    {
                        lst.Add(p);
                    }
                }
            }
            WebClientValueCollection.AddPropertyDescs(lst, this.CustomValues);
            return(new PropertyDescriptorCollection(lst.ToArray()));
        }
        public static PropertyDescriptorCollection GetWebClientProperties(IWebClientComponent obj, StringCollection names, Attribute[] attributes)
        {
            PropertyDescriptorCollection ps  = TypeDescriptor.GetProperties(obj, attributes, true);
            List <PropertyDescriptor>    lst = new List <PropertyDescriptor>();

            foreach (PropertyDescriptor p in ps)
            {
                if (names == null || names.Contains(p.Name))
                {
                    if (VPLUtil.IsCompiling)
                    {
                        lst.Add(p);
                    }
                    else
                    {
                        if (VPLUtil.HasAttribute(p, typeof(ReadOnlyInProgrammingAttribute)))
                        {
                            lst.Add(new ReadOnlyPropertyDesc(p));
                        }
                        else
                        {
                            lst.Add(p);
                        }
                    }
                }
            }
            WebClientValueCollection.AddPropertyDescs(lst, obj.CustomValues);
            return(new PropertyDescriptorCollection(lst.ToArray()));
        }
Exemplo n.º 3
0
        public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
        {
            PropertyDescriptorCollection ps = TypeDescriptor.GetProperties(this, attributes, true);
            //return ps;
            List <PropertyDescriptor> lst = new List <PropertyDescriptor>();

            foreach (PropertyDescriptor p in ps)
            {
                if (_propertyNames.Contains(p.Name))
                {
                    lst.Add(p);
                }
            }
            WebClientValueCollection.AddPropertyDescs(lst, this.CustomValues);
            return(new PropertyDescriptorCollection(lst.ToArray()));
        }
Exemplo n.º 4
0
        public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
        {
            PropertyDescriptorCollection ps  = TypeDescriptor.GetProperties(this, attributes, true);
            List <PropertyDescriptor>    lst = new List <PropertyDescriptor>();

            foreach (PropertyDescriptor p in ps)
            {
                if (_propertyNames.Contains(p.Name))
                {
                    lst.Add(p);
                }
            }
            HtmlTreeView htv = this.TreeView as HtmlTreeView;

            if (htv != null)
            {
                lst.Add(new PropertyDescriptorHtmlTreeNodeCollection(this, htv));
            }
            WebClientValueCollection.AddPropertyDescs(lst, this.CustomValues);
            return(new PropertyDescriptorCollection(lst.ToArray()));
        }