I have a class with a few basic properties...
[XmlAttribute("MyFirstProperty")]
public string FirstProperty { get; set; }
[XmlAttribute("MySecondProperty")]
public string SecondProperty { get; set; }
Using Reflection, I can enumerate through the public properties and get PropertyInfo objects for each of the properties above... the only thing I need now is a way to:
- Detect whether or not the property has a XmlAttribute (I'm thinking this works via PropertyInfo.IsDefined(typeof(XmlAttribute), true) but would like to make sure)
- Get the string value of the XmlAttribute
How is this done?