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)); }
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); }
PropertyDescriptor ITypeDescriptionProvider.GetProperty(string name) { PropertyDescriptor pd = Provider.GetProperty(name); return(pd ?? BaseTypeDescriptor.GetProperties()[name]); }
EventDescriptor ITypeDescriptionProvider.GetEvent(string name) { EventInfo ei = GetType().GetEvent(name); return(ei != null?Provider.GetEvent(name) : BaseTypeDescriptor.GetEvents()[name]); }