AttributeUsageAttribute 클래스

정의

다른 특성 클래스의 사용을 지정합니다. 이 클래스는 상속할 수 없습니다.

public ref class AttributeUsageAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Class, Inherited=true)]
public sealed class AttributeUsageAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Class, Inherited=true)]
[System.Serializable]
public sealed class AttributeUsageAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Class, Inherited=true)]
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class AttributeUsageAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class, Inherited=true)>]
type AttributeUsageAttribute = class
    inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Class, Inherited=true)>]
[<System.Serializable>]
type AttributeUsageAttribute = class
    inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Class, Inherited=true)>]
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type AttributeUsageAttribute = class
    inherit Attribute
Public NotInheritable Class AttributeUsageAttribute
Inherits Attribute
상속
AttributeUsageAttribute
특성

설명

고유한 특성 클래스를 정의할 때 특성 클래스에 배치 AttributeUsageAttribute 하여 사용하는 방식을 제어할 수 있습니다. 표시된 특성 클래스는 직접 또는 간접적으로 파생 Attribute되어야 합니다.

특성 클래스에는 위치 및 명명된 매개 변수가 있습니다. 특성 클래스에 대한 각 공용 생성자는 해당 클래스에 대한 유효한 위치 매개 변수 시퀀스를 정의합니다. 명명된 매개 변수는 특성 클래스의 비정적, 공용 및 읽기/쓰기 필드 또는 속성에 의해 정의됩니다.

세 가지 속성 AttributeUsageAttribute 은 다음 매개 변수를 정의하여 설정됩니다.

이 위치 매개 변수는 지정된 특성을 배치할 수 있는 프로그램 요소를 지정합니다. 특성을 배치할 수 있는 가능한 모든 요소 집합이 열거형에 AttributeTargets 나열됩니다. 비트 OR 연산을 사용하여 여러 AttributeTargets 값을 결합하여 유효한 프로그램 요소의 원하는 조합을 가져올 수 있습니다.

이 명명된 매개 변수는 지정된 프로그램 요소에 대해 지정된 특성을 두 번 이상 지정할 수 있는지 여부를 지정합니다.

이 명명된 매개 변수는 지정된 특성이 파생 클래스 및 재정의 멤버에 의해 상속될 수 있는지 여부를 지정합니다.

특성 사용에 대한 자세한 내용은 특성 및 특성을 참조 Attribute하세요.

생성자

Name Description
AttributeUsageAttribute(AttributeTargets)

지정된 목록, 값 및 값을 사용하여 클래스의 AttributeTargets새 인스턴스 AttributeUsageAttributeAllowMultipleInherited 초기화합니다.

속성

Name Description
AllowMultiple

지정된 특성의 인스턴스를 둘 이상 단일 프로그램 요소에 지정할 수 있는지 여부를 나타내는 부울 값을 가져오거나 설정합니다.

Inherited

지정된 특성이 파생 클래스 및 재정의 멤버에 의해 상속되는지 여부를 결정하는 값을 가져오거나 설정합니다 Boolean .

TypeId

파생 클래스에서 구현되는 경우 이 Attribute대한 고유 식별자를 가져옵니다.

(다음에서 상속됨 Attribute)
ValidOn

지정된 특성을 적용할 수 있는 프로그램 요소를 식별하는 값 집합을 가져옵니다.

메서드

Name Description
Equals(Object)

이 인스턴스가 지정된 개체와 같은지 여부를 나타내는 값을 반환합니다.

(다음에서 상속됨 Attribute)
GetHashCode()

이 인스턴스의 해시 코드를 반환합니다.

(다음에서 상속됨 Attribute)
GetType()

현재 인스턴스의 Type 가져옵니다.

(다음에서 상속됨 Object)
IsDefaultAttribute()

파생 클래스에서 재정의되는 경우 이 인스턴스의 값이 파생 클래스의 기본값인지 여부를 나타냅니다.

(다음에서 상속됨 Attribute)
Match(Object)

파생 클래스에서 재정의되는 경우 이 인스턴스가 지정된 개체와 같은지 여부를 나타내는 값을 반환합니다.

(다음에서 상속됨 Attribute)
MemberwiseClone()

현재 Object단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

명시적 인터페이스 구현

Name Description
_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

이름 집합을 해당 디스패치 식별자 집합에 매핑합니다.

(다음에서 상속됨 Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

인터페이스의 형식 정보를 가져오는 데 사용할 수 있는 개체의 형식 정보를 검색합니다.

(다음에서 상속됨 Attribute)
_Attribute.GetTypeInfoCount(UInt32)

개체가 제공하는 형식 정보 인터페이스의 수를 검색합니다(0 또는 1).

(다음에서 상속됨 Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

개체에 의해 노출되는 속성 및 메서드에 대한 액세스를 제공합니다.

(다음에서 상속됨 Attribute)

적용 대상

추가 정보