Hi,
I have a class which has a lot of events (>100). For some reasons, I have to
go through all invocation lists to do something. What I'm wondering is that,
is there any way to use reflection to get their InvocationList without going
through each event?
// tedious
foreach (Delegate handler in Event1.GetInvoc ationList()) {...}
foreach (Delegate handler in Event2.GetInvoc ationList()) {...}
foreach (Delegate handler in Event3.GetInvoc ationList()) {...}
....
foreach (Delegate handler in Event189.GetInv ocationList()) {...}
// user reflection???
.....
Looks like this is a hard question as I haven't googled any answers. Thanks
BK
I have a class which has a lot of events (>100). For some reasons, I have to
go through all invocation lists to do something. What I'm wondering is that,
is there any way to use reflection to get their InvocationList without going
through each event?
// tedious
foreach (Delegate handler in Event1.GetInvoc ationList()) {...}
foreach (Delegate handler in Event2.GetInvoc ationList()) {...}
foreach (Delegate handler in Event3.GetInvoc ationList()) {...}
....
foreach (Delegate handler in Event189.GetInv ocationList()) {...}
// user reflection???
.....
Looks like this is a hard question as I haven't googled any answers. Thanks
BK
Comment