PropertyInfo.Attributes 속성

정의

이 속성의 특성을 가져옵니다.

public:
 abstract property System::Reflection::PropertyAttributes Attributes { System::Reflection::PropertyAttributes get(); };
public abstract System.Reflection.PropertyAttributes Attributes { get; }
member this.Attributes : System.Reflection.PropertyAttributes
Public MustOverride ReadOnly Property Attributes As PropertyAttributes

속성 값

이 속성의 특성입니다.

구현

설명

속성은 AttributesPropertyInfo 개체가 나타내는 속성과 연결된 특성을 반환합니다. 특성은 주로 속성을 만들 때 컴파일러에서 적용되는 한정자입니다. 속성이 기본 속성인지, SpecialName 속성인지 여부를 나타냅니다. .NET Framework 클래스 라이브러리의 형식에 있는 거의 모든 속성의 경우 속성 값 Attributes 은 입니다PropertyAttributes.None.

대부분의 경우 속성과 연결된 사용자 지정 특성을 검색하려고 할 수 있습니다. 이렇게 하려면 속성 값을 CustomAttributes 검색하거나 메서드의 GetCustomAttributes 오버로드 중 하나를 호출합니다.

속성을 얻으려면 다음을 수행 Attributes 합니다.

  1. Type 속성이 속한 형식을 나타내는 개체를 가져옵니다.

  2. 메서드의 PropertyInfo 오버로드를 호출하여 개체를 가져옵니다 Type.GetProperty .

  3. 속성에서 속성의 특성을 검색합니다 Attributes .

메서드의 오버로드를 호출하고 인수에 대한 값을 제공하여 리플렉션 내보내기를 사용하여 동적으로 만든 형식에 대한 속성의 DefineProperty 특성을 정의할 attributes 수 있습니다.

적용 대상

추가 정보