我可能會錯誤地問這一點,但能/你怎麼能找到內本身的一類領域...例如...C#反思:查找屬性的一個成員字段
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();
}
或者,也許我只是這樣做不正確......如何調用一個方法,然後檢查應用於自身的屬性?
此外,爲了問題的緣故 - 我只是好奇,如果有可能找到屬性信息而不知道/訪問父類!
謝謝 - 這似乎是'可能的',但是我再次發現只有足夠的缺失而無法正常工作。 – Hugoware 2009-04-29 17:13:52