I may be asking this incorrectly, but can/how can you find fields on a class within itself... for example...
public class HtmlPart {
public void Render() {
//this.GetType().GetCustomAttributes(typeof(OptionalAttribute), false);
}
}
public class HtmlForm {
private HtmlPart _FirstPart = new HtmlPart();
[Optional] //<-- how do I find that?
private HtmlPart _SecondPart = new HtmlPart();
}
Or maybe I'm just doing this incorrectly... How can I call a method and then check for attributes applied to itself?
Also, for the sake of the question - I'm just curious if it was possible to find attribute information without knowing/accessing the parent class!