You can add attributes to type at runtime but only in a very special
circumstance.
Any object subject to reflection can be given a TypeDescriptionProvider.
This enables the TypeDescriptor to return any custom information yo may
desire, including dynamically created attributes, extra properties and
so-on.
Normally attributes are compiler generated, fixed and only instantiated when
reflection is used.
--
Bob Powell [MVP]
Visual C#, System.Drawing
Ramuseco Limited .NET consulting
http://www.ramuseco.com
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
<as*****@gmail.comwrote in message
news:11**********************@f1g2000cwa.googlegro ups.com...
Is there a way to add an Attribute to an existing type? Like say I
wanted to add a [MyCustomAttribute] to the List<inttype, how would I
go about doing that?
Also is there any way to attach Attributes to types at runtime?