Inherited속성 의 bool 속성은 무엇을 의미합니까?
속성 AbcAtribute(가있는 Inherited = true)을 사용하여 클래스를 정의 하고 해당 클래스에서 다른 클래스를 상속하면 파생 클래스에도 동일한 속성이 적용된다는 의미입니까?
코드 예제로이 질문을 명확히하기 위해 다음을 상상해보십시오.
[AttributeUsage(AttributeTargets.Class, Inherited = true)]
public class Random: Attribute
{ /* attribute logic here */ }
[Random]
class Mother
{ }
class Child : Mother
{ }
않습니다 Child또한이 Random적용된 속성을?
Inherited속성은 정교한 예제가 보여 그 사이의 차이Inherited=true와Inherited=false상속 클래스와 모두를위한override방법.