Please note that this is a different question than, the one which asks about finding all classes by custom attributes using reflection. I know that. What I am asking here is, when the attribute class is used, it increments a counter or whatever like a shared variable. I have explained below. I am listing the attribute usage by a class. I thought if there is a way that I can maintain a dictionary, whenever an object of the attribute is used by whatever object, so that I can keep both names in a dictionary and then, later on, do not search by reflection, assembly names etc. Example.
Class MyAttribute
Inherits Attribute
Sub New(byval name as string, optional byValue user as string = "")
me.name = name
me.user = user
'maintain dict here
End Sub
I want the user parameter, to be grabbed automatically by the system whatever class is using it. Say myclass is using it as
MyAttribute("bobe") ' note I am not passing user param, it should be auto to the name of the class MyClass here
MyClass
'exyz
End Class