How to get attribute

  • Thread starter Thread starter Boni
  • Start date Start date
B

Boni

Dear all,
if I have
<XmlElement("MULTITHREADED")> _Public m_multithreaded As Boolean



How do I get the attribute value at the run time?

I need something like

dim _attr as string=GetAttr(m_multithreaded,XmlElement)



Thanks alot,

Boni
 
Boni said:
Dear all,
if I have
<XmlElement("MULTITHREADED")> _Public m_multithreaded As Boolean



How do I get the attribute value at the run time?

I need something like

dim _attr as string=GetAttr(m_multithreaded,XmlElement)


Example in a Form:

<System.Xml.Serialization.XmlElementAttribute("MULTITHREADED")> _
Public m_multithreaded As Boolean

Private Sub Form_Load( _
ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles MyBase.Load

Dim atts As Object()

atts = Me.GetType.GetField("m_multithreaded").GetCustomAttributes( _
GetType(System.Xml.Serialization.XmlElementAttribute), False _
)

For Each att As System.Xml.Serialization.XmlElementAttribute In atts
'access att properties here
Next

End Sub


Armin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top