TypeDescriptor.GetAttributes 메서드

정의

구성 요소나 형식에 대한 특성 컬렉션을 반환합니다.

오버로드

GetAttributes(Object)

지정된 구성 요소에 대한 특성 컬렉션을 반환합니다.

GetAttributes(Type)

지정된 구성 요소 형식에 대한 특성 컬렉션을 반환합니다.

GetAttributes(Object, Boolean)

지정된 구성 요소에 대한 특성 컬렉션과 사용자 지정 형식 설명자가 만들어졌음을 나타내는 부울 값을 반환합니다.

GetAttributes(Object)

Source:
TypeDescriptor.cs
Source:
TypeDescriptor.cs
Source:
TypeDescriptor.cs

지정된 구성 요소에 대한 특성 컬렉션을 반환합니다.

public:
 static System::ComponentModel::AttributeCollection ^ GetAttributes(System::Object ^ component);
public static System.ComponentModel.AttributeCollection GetAttributes (object component);
static member GetAttributes : obj -> System.ComponentModel.AttributeCollection
Public Shared Function GetAttributes (component As Object) As AttributeCollection

매개 변수

component
Object

특성을 가져올 구성 요소입니다.

반환

구성 요소에 대한 특성을 포함하는 AttributeCollection 입니다. componentnull이면 이 메서드는 빈 컬렉션을 반환합니다.

예제

이 메서드의 예제는 메서드를 참조하세요 Matches .

설명

메서드에서 반환된 GetAttributes 특성은 extender 공급자(), 필터 서비스ITypeDescriptorFilterService(IExtenderProvider) 및 특성 필터를 통해 원래 구성 요소의 원본 목록에서 동적으로 수정할 수 있습니다.

로 설정된 true사용자 지정 특성을 AttributeUsageAttribute.AllowMultiple 정의하는 경우 속성을 재정의 Attribute.TypeId 하여 고유하게 만들어야 합니다. 특성의 모든 인스턴스가 고유한 Attribute.TypeId 경우 재정의하여 특성의 개체 ID를 반환합니다. 특성의 일부 인스턴스만 고유한 경우 에서 값을 Attribute.TypeId 반환하면 이러한 경우 같음이 반환됩니다. 예를 들어 일부 특성에는 고유 키 역할을 하는 생성자 매개 변수가 있습니다. 이러한 특성의 경우 속성에서 생성자 매개 변수의 값을 반환합니다 Attribute.TypeId .

참고

Attribute.TypeId 기본 구현은 속성 값에 관계없이 형식 ID를 AttributeUsageAttribute.AllowMultiple 반환합니다. 에서 특성의 여러 인스턴스를 AttributeUsageAttribute.AllowMultiple 반환하려면 특성이 AttributeCollection속성을 재정의 Attribute.TypeId 해야 합니다.

추가 정보

적용 대상

GetAttributes(Type)

Source:
TypeDescriptor.cs
Source:
TypeDescriptor.cs
Source:
TypeDescriptor.cs

지정된 구성 요소 형식에 대한 특성 컬렉션을 반환합니다.

public:
 static System::ComponentModel::AttributeCollection ^ GetAttributes(Type ^ componentType);
public static System.ComponentModel.AttributeCollection GetAttributes (Type componentType);
static member GetAttributes : Type -> System.ComponentModel.AttributeCollection
Public Shared Function GetAttributes (componentType As Type) As AttributeCollection

매개 변수

componentType
Type

대상 구성 요소의 Type입니다.

반환

구성 요소 형식에 대한 특성이 포함된 AttributeCollection 입니다. 구성 요소가 null이면 이 메서드는 빈 컬렉션을 반환합니다.

설명

개체의 instance 없는 경우에만 이 메서드 버전을 호출합니다.

AttributeUsageAttribute.AllowMultiple 설정된 true특성의 경우 특성 컬렉션은 중복 인스턴스를 제거합니다. 속성이 같은 값을 반환하는 Attribute.TypeId 인스턴스입니다.

로 설정된 true사용자 지정 특성을 AttributeUsageAttribute.AllowMultiple 정의하는 경우 속성을 재정의 Attribute.TypeId 하여 고유하게 만들어야 합니다. 특성의 모든 인스턴스가 고유한 Attribute.TypeId 경우 재정의하여 특성의 개체 ID를 반환합니다. 특성의 일부 인스턴스만 고유한 경우 에서 값을 Attribute.TypeId 반환하면 이러한 경우 같음이 반환됩니다. 예를 들어 일부 특성에는 고유 키 역할을 하는 생성자 매개 변수가 있습니다. 이러한 특성의 경우 속성에서 생성자 매개 변수의 값을 반환합니다 Attribute.TypeId .

참고

Attribute.TypeId 기본 구현은 속성 값에 관계없이 형식 ID를 AttributeUsageAttribute.AllowMultiple 반환합니다. 에서 특성의 여러 인스턴스를 AttributeUsageAttribute.AllowMultiple 반환하려면 특성이 AttributeCollection속성을 재정의 Attribute.TypeId 해야 합니다.

추가 정보

적용 대상

GetAttributes(Object, Boolean)

Source:
TypeDescriptor.cs
Source:
TypeDescriptor.cs
Source:
TypeDescriptor.cs

지정된 구성 요소에 대한 특성 컬렉션과 사용자 지정 형식 설명자가 만들어졌음을 나타내는 부울 값을 반환합니다.

public:
 static System::ComponentModel::AttributeCollection ^ GetAttributes(System::Object ^ component, bool noCustomTypeDesc);
public static System.ComponentModel.AttributeCollection GetAttributes (object component, bool noCustomTypeDesc);
static member GetAttributes : obj * bool -> System.ComponentModel.AttributeCollection
Public Shared Function GetAttributes (component As Object, noCustomTypeDesc As Boolean) As AttributeCollection

매개 변수

component
Object

특성을 가져올 구성 요소입니다.

noCustomTypeDesc
Boolean

componentICustomTypeDescriptor 형식인 경우 사용자 지정 형식 설명자에서 기본 특성 집합을 사용하려면 true이고, 그렇지 않으면 false입니다.

반환

구성 요소에 대한 특성을 포함하는 AttributeCollection 입니다. 구성 요소가 null이면 이 메서드는 빈 컬렉션을 반환합니다.

설명

메서드에서 반환된 GetAttributes 특성은 extender 공급자(), 필터 서비스ITypeDescriptorFilterService(IExtenderProvider) 및 특성 필터를 통해 원래 구성 요소 원본 목록에서 동적으로 수정할 수 있습니다.

로 설정된 true사용자 지정 특성을 AttributeUsageAttribute.AllowMultiple 정의하는 경우 속성을 재정의 Attribute.TypeId 하여 고유하게 만들어야 합니다. 특성의 모든 인스턴스가 고유한 Attribute.TypeId 경우 재정의하여 특성의 개체 ID를 반환합니다. 특성의 일부 인스턴스만 고유한 경우 에서 값을 Attribute.TypeId 반환하면 이러한 경우 같음이 반환됩니다. 예를 들어 일부 특성에는 고유 키 역할을 하는 생성자 매개 변수가 있습니다. 이러한 특성의 경우 속성에서 생성자 매개 변수의 값을 반환합니다 Attribute.TypeId .

참고

Attribute.TypeId 기본 구현은 속성 값에 관계없이 형식 ID를 AttributeUsageAttribute.AllowMultiple 반환합니다. 에서 특성의 여러 인스턴스를 AttributeUsageAttribute.AllowMultiple 반환하려면 특성이 AttributeCollection속성을 재정의 Attribute.TypeId 해야 합니다.

추가 정보

적용 대상