Assign attributes to a property at runtime ?

  • Thread starter Thread starter Herve Bocuse
  • Start date Start date
H

Herve Bocuse

Hi,

I use a class and I don't have the sources. One of its properties may
or may not have some attributes assigned to it. What I want is to
assign some more attributes to the property at runtime. Is it possible
to do that and how ?

Thank you

Herve
 
Herve Bocuse said:
Hi,

I use a class and I don't have the sources. One of its properties may
or may not have some attributes assigned to it. What I want is to
assign some more attributes to the property at runtime. Is it possible
to do that and how ?

No you can't. You could use Reflection.Emit to create a class that is
identical to the class you're interested in, with the attributes added
though.
 
Back
Top