2
예 :이 클래스 내가 propHead 및 propControl을 제외해야클래스 속성 컬렉션을 필터링하는 방법은 무엇입니까?
public class MyClass
{
private string propHead;
private string PropHead { get; set; }
private int prop01;
private int Prop01 { get; set; }
private string prop02;
private string Prop02 { get; set; }
// ... some more properties here
private string propControl;
private string PropControl { get; } // always readonly
}
있습니다. 는 propControl를 제외하려면 :
이제MyClass mc = new MyClass();
PropertyInfo[] allProps = mc.GetType().GetProperties().Where(x => x.CanWrite).ToArray();
, 내가 propHead? 접근성의 모든 주와 동일한 수준을 제외 할 수있는 방법. propHead에 다른 특성을 추가 할 수있는 특수 특성을 추가 할 수있는 방법이 있습니까? 속성 이름은 항상 각 클래스마다 다릅니다.
의견이 있으면 매우 감사하겠습니다.