Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Custom attribute question

Status
Not open for further replies.

BKQc

Programmer
Jul 26, 2002
118
CA
I'm trying to build a little "autonomous" object factory that is using reflection and attributes to know what are the available object types.

Actually, the custom attribute looks like
<ObjectFactory(13)>

Where 13 is the object type id. So say in my DB I have an object for which I stored the object ID 13, now I simply call the factory with GetTypedObject(objectId) and it will extract the constructor from a dictionary based on ObjectTypeId.

Since the classes using this attribute must have a specific constructor to be a valid Factory builder, I had a method looking for this constructor within the factory but I thought that this role should go to the attribute itself so I started to move this logic and that is when I faced my problem:

how can I access the type of the class to which this attribute is attached?

Thank you for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top