PC Review


Reply
Thread Tools Rate Thread

Assign attributes to a property at runtime ?

 
 
Herve Bocuse
Guest
Posts: n/a
 
      21st Feb 2005
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

 
Reply With Quote
 
 
 
 
Sean Hederman
Guest
Posts: n/a
 
      21st Feb 2005
"Herve Bocuse" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.

> Thank you
>
> Herve
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How could I change the NavigateUrl property at runtime based on another controls property ? Radu Microsoft ASP .NET 2 25th Jan 2007 11:51 AM
Changing property attributes at runtime Kimmo Laine Microsoft C# .NET 5 16th Oct 2006 11:53 AM
Assign property from db to object property? Burt Microsoft VB .NET 2 7th Feb 2006 11:33 PM
Custom Attributes (AttributeTargets.Property) and Property Type Zarko Gajic Microsoft C# .NET 1 8th Apr 2005 03:58 PM
how to assign xml perfix with xml attributes? AA Microsoft Dot NET Framework 2 30th Apr 2004 10:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:10 PM.