B
BK
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.GetInvocationList()) {...}
foreach (Delegate handler in Event2.GetInvocationList()) {...}
foreach (Delegate handler in Event3.GetInvocationList()) {...}
....
foreach (Delegate handler in Event189.GetInvocationList()) {...}
// 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.GetInvocationList()) {...}
foreach (Delegate handler in Event2.GetInvocationList()) {...}
foreach (Delegate handler in Event3.GetInvocationList()) {...}
....
foreach (Delegate handler in Event189.GetInvocationList()) {...}
// user reflection???
.....
Looks like this is a hard question as I haven't googled any answers. Thanks
BK