示例#1
0
        AttributeCollection ITypeDescriptionProvider.GetAttributes()
        {
            AttributeCollection col1 = Provider.GetAttributes();
            AttributeCollection col2 = BaseTypeDescriptor.GetAttributes();

            Attribute[] attrs = new Attribute[col1.Count + col2.Count];

            for (int i = 0; i < col1.Count; i++)
            {
                attrs[i] = col1[i];
            }

            for (int i = 0; i < col2.Count; i++)
            {
                attrs[col1.Count + i] = col2[i];
            }

            return(new AttributeCollection(attrs));
        }
示例#2
0
        EventDescriptorCollection ITypeDescriptionProvider.GetEvents()
        {
            EventDescriptorCollection col1 = Provider.GetEvents();
            EventDescriptorCollection col2 = BaseTypeDescriptor.GetEvents();

            EventDescriptorCollection col = new EventDescriptorCollection(new EventDescriptor[0]);

            foreach (EventDescriptor ed in col1)
            {
                col.Add(ed);
            }

            foreach (EventDescriptor ed in col2)
            {
                if (col.Find(ed.Name, false) == null)
                {
                    col.Add(ed);
                }
            }

            return(col);
        }
示例#3
0
        PropertyDescriptor ITypeDescriptionProvider.GetProperty(string name)
        {
            PropertyDescriptor pd = Provider.GetProperty(name);

            return(pd ?? BaseTypeDescriptor.GetProperties()[name]);
        }
示例#4
0
        EventDescriptor ITypeDescriptionProvider.GetEvent(string name)
        {
            EventInfo ei = GetType().GetEvent(name);

            return(ei != null?Provider.GetEvent(name) : BaseTypeDescriptor.GetEvents()[name]);
        }