private static Attribute[] InternalGetCustomAttributes(EventInfo element, Type type, bool inherit)
{
// walk up the hierarchy chain
Attribute[] attributes = (Attribute[])element.GetCustomAttributes(type, inherit);
if (inherit)
{
// create the hashtable that keeps track of inherited types
Hashtable types = new Hashtable(11);
// create an array list to collect all the requested attibutes
ArrayList attributeList = new ArrayList();
CopyToArrayList(attributeList, attributes, types);
EventInfo baseEvent = GetParentDefinition(element);
while (baseEvent != null)
{
attributes = GetCustomAttributes(baseEvent, type, false);
AddAttributesToList(attributeList, attributes, types);
baseEvent = GetParentDefinition(baseEvent);
}
return (Attribute[])attributeList.ToArray(type);
}
else
return attributes;
}
private static EventInfo GetParentDefinition(EventInfo ev)