.NETGURU
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




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification