Is it possible to use reflection to find all insta...
# announcements
b
Is it possible to use reflection to find all instances of a property Delegate type?
s
I would assume you can use
Copy code
class.declaredMemberProperties
for that purpose
m
you can’t find all instances of a type with reflection, because it’s meant to introspect types, to access their structure at runtime. If you need to track the instances of a delegate, you need to add a data structure and some logic to save their references
b
Alright, so sounds like maybe I could find all classes within a package, and from there check each
delcaredMemberProperties
to check for the delegate type. Not sure I'll end up doing this, was just curious if there was any good way available.
Thanks 👍
s
maybe look at this @bbaldino
if this is of help
b
Thanks! That does help.
s
cool