Search:
Namespaces
Discussions
.NET v1.1
Feedback
Code dom and Attributes
Messages
Related Types
This message was discovered on
microsoft.public.dotnet.languages.csharp
.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...
Wayne
I need to add some attributes and look at existing attributes to a property.
Not the private/public stuff, but rather something like:
System.Xml.Serialization.
XmlElementAttribute
What should I look at for doing this?
Thanks
Wayne
Reply to this message...
Nicholas Paldino [.NET/C# MVP] (VIP)
Wayne,
I would check for an Attributes property on the CodeDom elements that
you are adding. It should return a collection which will allow you to add
CodeAttributeDeclaration
instances which would be the declarations for the
attributes.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
Click here to reveal e-mail address
"Wayne" <
Click here to reveal e-mail address
> wrote in message
news:%
Click here to reveal e-mail address
...
[Original message clipped]
Reply to this message...
Kevin Yu [MSFT] (VIP)
Thanks for Nicholas's quick reponse!
Hi Wayne,
First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to add some customized
attributes to codedom member. If there is any misunderstanding, please feel
free to let me know.
As far as I know, the
CodeTypeMember
.CustomAttributes property can do this
for us. You can try to create a
CodeAttributeDeclaration
object and then
add it to the CustomAttributes collection. For more information, please
check the following links:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfSystemCodeDomCodeAttributeDeclarationClassTopic.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemcodedomcodetypememberclasscustomattributestopic.asp
HTH.
Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
Reply to this message...
System.CodeDom.CodeAttributeDeclaration
System.CodeDom.CodeTypeMember
System.Xml.Serialization.XmlElementAttribute
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us
-
Terms of Use
-
Privacy Policy
-
www.dotnet247.com