Esempio n. 1
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);
        }
Esempio n. 2
0
        EventDescriptor ITypeDescriptionProvider.GetEvent(string name)
        {
            EventInfo ei = GetType().GetEvent(name);

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