TypeDescriptor.GetProperties 메서드

정의

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

오버로드

GetProperties(Object, Attribute[], Boolean)

지정한 특성 배열을 필터로 사용하고 사용자 지정 특성 설명자를 사용하여 지정된 구성 요소에 대한 속성 컬렉션을 반환합니다.

GetProperties(Object, Boolean)

기본 형식 설명자를 사용하여 지정된 구성 요소에 대한 속성 컬렉션을 반환합니다.

GetProperties(Type, Attribute[])

지정한 특성 배열을 필터로 사용하여 지정된 구성 요소 형식에 대한 속성 컬렉션을 반환합니다.

GetProperties(Type)

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

GetProperties(Object)

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

GetProperties(Object, Attribute[])

지정한 특성 배열을 필터로 사용하여 지정된 구성 요소에 대한 속성 컬렉션을 반환합니다.

GetProperties(Object, Attribute[], Boolean)

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

지정한 특성 배열을 필터로 사용하고 사용자 지정 특성 설명자를 사용하여 지정된 구성 요소에 대한 속성 컬렉션을 반환합니다.

public:
 static System::ComponentModel::PropertyDescriptorCollection ^ GetProperties(System::Object ^ component, cli::array <Attribute ^> ^ attributes, bool noCustomTypeDesc);
public static System.ComponentModel.PropertyDescriptorCollection GetProperties (object component, Attribute[] attributes, bool noCustomTypeDesc);
public static System.ComponentModel.PropertyDescriptorCollection GetProperties (object component, Attribute[]? attributes, bool noCustomTypeDesc);
static member GetProperties : obj * Attribute[] * bool -> System.ComponentModel.PropertyDescriptorCollection
Public Shared Function GetProperties (component As Object, attributes As Attribute(), noCustomTypeDesc As Boolean) As PropertyDescriptorCollection

매개 변수

component
Object

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

attributes
Attribute[]

필터로 사용할 Attribute 형식의 배열입니다.

noCustomTypeDesc
Boolean

사용자 지정 형식 설명 정보를 고려하지 않으려면true 이고, 고려하려면 false입니다.

반환

지정된 구성 요소에 대한 지정된 특성과 일치하는 이벤트를 갖는 PropertyDescriptorCollection 입니다.

예외

component 는 크로스 프로세스 원격 개체입니다.

설명

의 속성 component 은 클래스의 속성과 다를 수 있습니다. 이 있는 경우 component 사이트에서 속성을 추가하거나 제거할 수 있기 때문입니다.

attributes 매개 변수 배열은 배열을 필터링하는 데 사용됩니다. 필터링은 다음 규칙에 의해 정의됩니다.

  • 속성에 동일한 클래스의 가 Attribute 없으면 반환된 배열에 속성이 포함되지 않습니다.

  • 특성이 클래스의 Attribute instance 경우 속성은 정확히 일치해야 합니다. 그렇지 않으면 반환된 배열에 포함되지 않습니다.

  • Attribute instance 지정되고 기본 속성인 경우 속성에 의 instance Attribute 없더라도 반환된 배열에 포함됩니다.

  • 기본 특성이 있는 경우 attributes 메서드는 GetProperties 속성에 특성이 적용되지 않은 경우 사례와 일치합니다.

매개 변수가 이 componentnull면 빈 컬렉션이 반환됩니다.

반환된 컬렉션의 순서가 호출 간에 동일하지는 않으므로 항상 사용하기 전에 순서를 지정합니다.

추가 정보

적용 대상

GetProperties(Object, Boolean)

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

기본 형식 설명자를 사용하여 지정된 구성 요소에 대한 속성 컬렉션을 반환합니다.

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

매개 변수

component
Object

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

noCustomTypeDesc
Boolean

사용자 지정 형식 설명 정보를 고려하지 않으려면true 이고, 고려하려면 false입니다.

반환

지정된 구성 요소에 대한 속성을 가진 PropertyDescriptorCollection 입니다.

예외

component 는 크로스 프로세스 원격 개체입니다.

설명

매개 변수가 있는 component 경우 component 사이트에서 속성을 추가하거나 제거할 수 있으므로 매개 변수의 속성은 클래스의 속성과 다를 수 있습니다.

이 이nullcomponent 빈 컬렉션이 반환됩니다.

반환된 컬렉션의 순서가 호출 간에 동일하지는 않으므로 항상 사용하기 전에 순서를 지정합니다.

추가 정보

적용 대상

GetProperties(Type, Attribute[])

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

지정한 특성 배열을 필터로 사용하여 지정된 구성 요소 형식에 대한 속성 컬렉션을 반환합니다.

public:
 static System::ComponentModel::PropertyDescriptorCollection ^ GetProperties(Type ^ componentType, cli::array <Attribute ^> ^ attributes);
public static System.ComponentModel.PropertyDescriptorCollection GetProperties (Type componentType, Attribute[] attributes);
public static System.ComponentModel.PropertyDescriptorCollection GetProperties (Type componentType, Attribute[]? attributes);
static member GetProperties : Type * Attribute[] -> System.ComponentModel.PropertyDescriptorCollection
Public Shared Function GetProperties (componentType As Type, attributes As Attribute()) As PropertyDescriptorCollection

매개 변수

componentType
Type

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

attributes
Attribute[]

필터로 사용할 Attribute 형식의 배열입니다.

반환

이 형식의 구성 요소에 대한 지정된 특성과 일치하는 속성을 갖는 PropertyDescriptorCollection 입니다.

예제

다음 코드 예제를 구현 하는 방법에 설명 합니다 GetProperties 메서드. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 PropertyTab 클래스입니다.

// Returns the properties of the specified component extended with
// a CategoryAttribute reflecting the name of the type of the property.
[ReflectionPermission(SecurityAction::Demand, Flags=ReflectionPermissionFlag::MemberAccess)]
virtual System::ComponentModel::PropertyDescriptorCollection^ GetProperties( Object^ component, array<System::Attribute^>^attributes ) override
{
   PropertyDescriptorCollection^ props;
   if ( attributes == nullptr )
            props = TypeDescriptor::GetProperties( component );
   else
            props = TypeDescriptor::GetProperties( component, attributes );

   array<PropertyDescriptor^>^propArray = gcnew array<PropertyDescriptor^>(props->Count);
   for ( int i = 0; i < props->Count; i++ )
   {
      // Create a new PropertyDescriptor from the old one, with
      // a CategoryAttribute matching the name of the type.
      array<Attribute^>^temp0 = {gcnew CategoryAttribute( props[ i ]->PropertyType->Name )};
      propArray[ i ] = TypeDescriptor::CreateProperty( props[ i ]->ComponentType, props[ i ], temp0 );

   }
   return gcnew PropertyDescriptorCollection( propArray );
}

virtual System::ComponentModel::PropertyDescriptorCollection^ GetProperties( Object^ component ) override
{
   return this->GetProperties( component, nullptr );
}
// Returns the properties of the specified component extended with 
// a CategoryAttribute reflecting the name of the type of the property.
public override System.ComponentModel.PropertyDescriptorCollection GetProperties(object component, System.Attribute[] attributes)
{
    PropertyDescriptorCollection props;
    if( attributes == null )
        props = TypeDescriptor.GetProperties(component);    
    else
        props = TypeDescriptor.GetProperties(component, attributes);    
    
    PropertyDescriptor[] propArray = new PropertyDescriptor[props.Count];            
    for(int i=0; i<props.Count; i++)           
    {                
        // Create a new PropertyDescriptor from the old one, with 
        // a CategoryAttribute matching the name of the type.
        propArray[i] = TypeDescriptor.CreateProperty(props[i].ComponentType, props[i], new CategoryAttribute(props[i].PropertyType.Name));
    }
    return new PropertyDescriptorCollection( propArray );
}

public override System.ComponentModel.PropertyDescriptorCollection GetProperties(object component)
{                     
    return this.GetProperties(component, null);
}

설명

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

attributes 매개 변수 배열은 배열을 필터링하는 데 사용됩니다. 필터링은 다음 규칙에 의해 정의됩니다.

  • 속성에 동일한 클래스의 가 Attribute 없으면 반환된 배열에 속성이 포함되지 않습니다.

  • 특성이 클래스의 Attribute instance 경우 속성은 정확히 일치해야 합니다. 그렇지 않으면 반환된 배열에 포함되지 않습니다.

  • Attribute instance 지정되고 기본 속성인 경우 속성에 의 instance Attribute 없더라도 반환된 배열에 포함됩니다.

  • 기본 특성이 있는 경우 attributes 메서드는 GetProperties 속성에 특성이 적용되지 않은 경우 사례와 일치합니다.

매개 변수가 이 componentTypenull면 빈 컬렉션이 반환됩니다.

반환된 컬렉션의 순서가 호출 간에 동일하지는 않으므로 항상 사용하기 전에 순서를 지정합니다.

추가 정보

적용 대상

GetProperties(Type)

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

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

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

매개 변수

componentType
Type

속성을 가져올 구성 요소를 나타내는 Type 입니다.

반환

구성 요소의 지정된 형식의 대한 속성을 갖는 PropertyDescriptorCollection 입니다.

설명

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

매개 변수가 이 componentTypenull면 빈 컬렉션이 반환됩니다.

반환된 컬렉션의 순서가 호출 간에 동일하지는 않으므로 항상 사용하기 전에 순서를 지정합니다.

추가 정보

적용 대상

GetProperties(Object)

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

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

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

매개 변수

component
Object

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

반환

지정된 구성 요소의 속성을 갖는 PropertyDescriptorCollection 입니다.

예외

component 는 크로스 프로세스 원격 개체입니다.

예제

다음 코드 예제를 사용 GetProperties 하는 방법을 보여 줍니다는 컨트롤의 속성에 액세스 하는 방법입니다. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 ComponentDesigner 클래스입니다.

// This is the shadowed property on the designer.
// This value will be serialized instead of the 
// value of the control's property.
public Color BackColor
{
    get
    {
        return (Color)ShadowProperties["BackColor"];
    }
    set
    {
        if (this.changeService != null)
        {
            PropertyDescriptor backColorDesc =
                TypeDescriptor.GetProperties(this.Control)["BackColor"];

            this.changeService.OnComponentChanging(
                this.Control,
                backColorDesc);

            this.ShadowProperties["BackColor"] = value;

            this.changeService.OnComponentChanged(
                this.Control,
                backColorDesc,
                null,
                null);
        }
    }
}
' This is the shadowed property on the designer.
' This value will be serialized instead of the 
' value of the control's property.

Public Property BackColor() As Color
    Get
        Return CType(ShadowProperties("BackColor"), Color)
    End Get
    Set(ByVal value As Color)
        If (Me.changeService IsNot Nothing) Then
            Dim backColorDesc As PropertyDescriptor = TypeDescriptor.GetProperties(Me.Control)("BackColor")

            Me.changeService.OnComponentChanging(Me.Control, backColorDesc)

            Me.ShadowProperties("BackColor") = value

            Me.changeService.OnComponentChanged(Me.Control, backColorDesc, Nothing, Nothing)
        End If
    End Set
End Property

설명

구성 요소의 속성은 클래스의 속성과 다를 수 있습니다. 구성 요소가 배치된 경우 사이트에서 속성을 추가하거나 제거할 수 있기 때문입니다.

매개 변수가 이 componentnull면 빈 컬렉션이 반환됩니다.

반환된 컬렉션의 순서가 호출 간에 동일하지는 않으므로 항상 사용하기 전에 순서를 지정합니다.

추가 정보

적용 대상

GetProperties(Object, Attribute[])

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

지정한 특성 배열을 필터로 사용하여 지정된 구성 요소에 대한 속성 컬렉션을 반환합니다.

public:
 static System::ComponentModel::PropertyDescriptorCollection ^ GetProperties(System::Object ^ component, cli::array <Attribute ^> ^ attributes);
public static System.ComponentModel.PropertyDescriptorCollection GetProperties (object component, Attribute[] attributes);
public static System.ComponentModel.PropertyDescriptorCollection GetProperties (object component, Attribute[]? attributes);
static member GetProperties : obj * Attribute[] -> System.ComponentModel.PropertyDescriptorCollection
Public Shared Function GetProperties (component As Object, attributes As Attribute()) As PropertyDescriptorCollection

매개 변수

component
Object

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

attributes
Attribute[]

필터로 사용할 Attribute 형식의 배열입니다.

반환

지정된 구성 요소에 대한 지정된 특성과 일치하는 속성을 갖는 PropertyDescriptorCollection 입니다.

예외

component 는 크로스 프로세스 원격 개체입니다.

예제

다음 코드 예제를 구현 하는 방법에 설명 합니다 GetProperties 메서드. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 PropertyTab 클래스입니다.

// Returns the properties of the specified component extended with
// a CategoryAttribute reflecting the name of the type of the property.
[ReflectionPermission(SecurityAction::Demand, Flags=ReflectionPermissionFlag::MemberAccess)]
virtual System::ComponentModel::PropertyDescriptorCollection^ GetProperties( Object^ component, array<System::Attribute^>^attributes ) override
{
   PropertyDescriptorCollection^ props;
   if ( attributes == nullptr )
            props = TypeDescriptor::GetProperties( component );
   else
            props = TypeDescriptor::GetProperties( component, attributes );

   array<PropertyDescriptor^>^propArray = gcnew array<PropertyDescriptor^>(props->Count);
   for ( int i = 0; i < props->Count; i++ )
   {
      // Create a new PropertyDescriptor from the old one, with
      // a CategoryAttribute matching the name of the type.
      array<Attribute^>^temp0 = {gcnew CategoryAttribute( props[ i ]->PropertyType->Name )};
      propArray[ i ] = TypeDescriptor::CreateProperty( props[ i ]->ComponentType, props[ i ], temp0 );

   }
   return gcnew PropertyDescriptorCollection( propArray );
}

virtual System::ComponentModel::PropertyDescriptorCollection^ GetProperties( Object^ component ) override
{
   return this->GetProperties( component, nullptr );
}
// Returns the properties of the specified component extended with 
// a CategoryAttribute reflecting the name of the type of the property.
public override System.ComponentModel.PropertyDescriptorCollection GetProperties(object component, System.Attribute[] attributes)
{
    PropertyDescriptorCollection props;
    if( attributes == null )
        props = TypeDescriptor.GetProperties(component);    
    else
        props = TypeDescriptor.GetProperties(component, attributes);    
    
    PropertyDescriptor[] propArray = new PropertyDescriptor[props.Count];            
    for(int i=0; i<props.Count; i++)           
    {                
        // Create a new PropertyDescriptor from the old one, with 
        // a CategoryAttribute matching the name of the type.
        propArray[i] = TypeDescriptor.CreateProperty(props[i].ComponentType, props[i], new CategoryAttribute(props[i].PropertyType.Name));
    }
    return new PropertyDescriptorCollection( propArray );
}

public override System.ComponentModel.PropertyDescriptorCollection GetProperties(object component)
{                     
    return this.GetProperties(component, null);
}

설명

매개 변수가 있는 component 경우 component 사이트에서 속성을 추가하거나 제거할 수 있으므로 매개 변수의 속성은 클래스의 속성과 다를 수 있습니다.

attributes 매개 변수 배열은 배열을 필터링하는 데 사용됩니다. 필터링은 다음 규칙에 의해 정의됩니다.

  • 속성에 동일한 클래스의 가 Attribute 없으면 반환된 배열에 속성이 포함되지 않습니다.

  • 특성이 클래스의 Attribute instance 경우 속성은 정확히 일치해야 합니다. 그렇지 않으면 반환된 배열에 포함되지 않습니다.

  • Attribute instance 지정되고 기본 속성인 경우 속성에 의 instance Attribute 없더라도 반환된 배열에 포함됩니다.

  • 기본 특성이 있는 경우 attributes 메서드는 GetProperties 속성에 특성이 적용되지 않은 경우 사례와 일치합니다.

이 이nullcomponent 빈 컬렉션이 반환됩니다.

반환된 컬렉션의 순서가 호출 간에 동일하지는 않으므로 항상 사용하기 전에 순서를 지정합니다.

추가 정보

적용 대상