Home All Groups Group Topic Archive Search About

Build reflection call into base class?

Author
8 Jan 2007 8:15 PM
Barry Gilbert
I'm looking for a way to expose property attributes in a derived class. I'm
declaring Description attributes like this:

Public Class Employee
    <Description("Last Name")> _
    Public Overridable Property NameLast() As String
....

I'd like to somehow be able to refer to the description with syntax like this:
objEmployee.NameLast.Description. I'm new to reflection, but I've worked out
how to get at the attributes collection and get to this particular attribute,
but I'd like to have the base class contain this functionality so that it is
available to every property in every derived class without having to code it
for each class and property.

Any suggestions would be very welcome.

Barry

AddThis Social Bookmark Button