AttributeTable.GetCustomAttributes 메서드 (Type)

지정된 형식에 대해 제공되는 모든 특성의 열거형을 반환합니다.

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

구문

‘선언
Public Function GetCustomAttributes ( _
    type As Type _
) As IEnumerable
public IEnumerable GetCustomAttributes(
    Type type
)
public:
IEnumerable^ GetCustomAttributes(
    Type^ type
)
member GetCustomAttributes : 
        type:Type -> IEnumerable 
public function GetCustomAttributes(
    type : Type
) : IEnumerable

매개 변수

  • type
    형식: System.Type
    클래스 수준 특성을 가져올 형식입니다.

반환 값

형식: System.Collections.IEnumerable
특성의 열거형입니다.

예외

예외 상황
ArgumentNullException

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

설명

이 메서드에서는 nullNull 참조(Visual Basic의 경우 Nothing) 열거형을 반환하지 않습니다.

예제

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

Dim attrs0 As IEnumerable = attributes.GetCustomAttributes(GetType(Button))
IEnumerable attrs0 = attributes.GetCustomAttributes(typeof(Button));

.NET Framework 보안

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

참고 항목

참조

AttributeTable 클래스

GetCustomAttributes 오버로드

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

AttributeTableBuilder