AttributeTable.ContainsAttributes 메서드

이 테이블에 지정된 형식에 대한 메타데이터가 있는지 여부를 나타내는 값을 반환합니다.

네임스페이스:  Microsoft.Windows.Design.Metadata
어셈블리:  Microsoft.Windows.Design.Extensibility(Microsoft.Windows.Design.Extensibility.dll)

구문

‘선언
Public Function ContainsAttributes ( _
    type As Type _
) As Boolean
public bool ContainsAttributes(
    Type type
)
public:
bool ContainsAttributes(
    Type^ type
)
member ContainsAttributes : 
        type:Type -> bool 
public function ContainsAttributes(
    type : Type
) : boolean

매개 변수

  • type
    형식: System.Type
    메타데이터 특성을 확인할 형식입니다.

반환 값

형식: System.Boolean
테이블에 지정된 형식에 대한 특성이 있으면 true이고, 그렇지 않으면 false입니다.

예외

예외 상황
ArgumentNullException

type는 nullNull 참조(Visual Basic의 경우 Nothing)입니다.

설명

메타데이터는 클래스 수준 메타데이터이거나 DependencyProperty 또는 MemberDescriptor에 연결된 메타데이터일 수 있습니다. 디자이너에서는 이 메서드를 사용하여 새 특성 테이블이 추가될 때 Refreshed 이벤트를 발생시켜야 하는 로드된 형식을 식별하고 특성 쿼리 도중 추가로 쿼리해야 하는 테이블을 빠르게 판단합니다.

예제

다음 코드 예제에서는 ContainsAttributes 메서드를 사용하여 형식에 사용자 지정 특성이 있는지 확인하는 방법을 보여 줍니다. 이 코드 예제는 AttributeTable 클래스에 대해 제공되는 보다 큰 예제의 일부입니다.

Dim hasCustomAttributes As Boolean = attributes.ContainsAttributes(GetType(Button))
bool hasCustomAttributes = attributes.ContainsAttributes(typeof(Button));

.NET Framework 보안

  • 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.

참고 항목

참조

AttributeTable 클래스

Microsoft.Windows.Design.Metadata 네임스페이스

AttributeTableBuilder