public static EventDescriptorCollection GetEvents
(Type componentType, Attribute[] attributes)
{
lock (typeof(TypeDescriptor))
{
TypeElement element = GetOrCreateElement(componentType);
if (element.events != null)
{
return(element.events);
}
EventDescriptorCollection coll;
coll = new EventDescriptorCollection(null);
foreach (EventInfo eventInfo in componentType.GetEvents())
{
coll.Add(new BuiltinEventDescriptor
(eventInfo, attributes));
}
element.events = coll;
return(coll);
}
}