I am stuck now at method to retrieve access modifiers of EventInfo object (reflected event field in C# .NET).
By access modifiers I mean: public/private/protected/internal and static, readonly etc.
In theory (at the IL level) there are basically three members making up the event:
You can access each of those via a separate EventInfo
property (AddMethod
, RemoveMethod
, RaiseMethod
) and check the access modifier for each of them. For events declared in C#, I'd expect no raise method, and the add/remove methods to have the same accessibility.
See more on this question at Stackoverflow