I would like to be able to enumerate all events, which a class implements.
class A
{
public delegate void X();
public event X EventA;
}
class B:A
{
public event X EventB;
}
What should I do to typeof(B) to get a list, which would consist of EventB?
Well, there’s the
Type.GetEventsmethod, you should use it. If you only want events declared at B, and not inherited from A, passDeclaredOnlyas one of the binding flags.