1
Vote

SPEventsManager shows only direct descendants of SPListEventReceiver and SPItemEventReceiver

description

The "Add new event" page filters the classes in the assembly by checking the direct derivation of these classes. It is easily fixed to use the Type.IsSubClass() method.
 
In the LoadAssembly() method, change the line
    if (curType.IsClass && curType.BaseType == typeof(SPItemEventReceiver) || curType.BaseType == typeof(SPListEventReceiver))
into
    if (curType.IsClass && (curType.IsSubclassOf(typeof(SPItemEventReceiver)) || curType.IsSubclassOf(typeof(SPListEventReceiver))))

comments