PropertyDescriptorCollection 클래스

정의

PropertyDescriptor 개체의 컬렉션을 나타냅니다.

public ref class PropertyDescriptorCollection : System::Collections::IDictionary, System::Collections::IList
public class PropertyDescriptorCollection : System.Collections.IDictionary, System.Collections.IList
type PropertyDescriptorCollection = class
    interface ICollection
    interface IEnumerable
    interface IDictionary
    interface IList
type PropertyDescriptorCollection = class
    interface IList
    interface IDictionary
    interface ICollection
    interface IEnumerable
type PropertyDescriptorCollection = class
    interface ICollection
    interface IEnumerable
    interface IList
    interface IDictionary
type PropertyDescriptorCollection = class
    interface ICollection
    interface IList
    interface IDictionary
    interface IEnumerable
Public Class PropertyDescriptorCollection
Implements IDictionary, IList
상속
PropertyDescriptorCollection
구현

예제

다음 코드 예제에서는 에 속성을 button1사용 하 여 새 PropertyDescriptorCollection 만듭니다. 폼에서 button1 인스턴스화해야 합니다.

PropertyDescriptorCollection^ properties = TypeDescriptor::GetProperties( button1 );
PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(button1);
Dim properties As PropertyDescriptorCollection = TypeDescriptor.GetProperties(button1)

다음은 텍스트 상자의 단추에 있는 모든 속성을 인쇄하는 예제입니다. 이를 요구 button1 하며 textBox1 양식에서 인스턴스화되었습니다.

private:
   void MyPropertyCollection()
   {
      // Creates a new collection and assign it the properties for button1.
      PropertyDescriptorCollection^ properties = TypeDescriptor::GetProperties( button1 );
      
      // Displays each property in the collection in a text box.
      for each ( PropertyDescriptor^ myProperty in properties )
      {
         textBox1->Text = String::Concat( textBox1->Text, myProperty->Name, "\n" );
      }
   }
private void MyPropertyCollection() {
    // Creates a new collection and assign it the properties for button1.
    PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(button1);
 
    // Displays each property in the collection in a text box.
    foreach (PropertyDescriptor myProperty in properties)
       textBox1.Text += myProperty.Name + '\n';
 }
Private Sub MyPropertyCollection()
    ' Creates a new collection and assign it the properties for button1.
    Dim properties As PropertyDescriptorCollection = TypeDescriptor.GetProperties(button1)
    
    ' Displays each property in the collection in a text box.
    Dim myProperty As PropertyDescriptor
    For Each myProperty In  properties
        textBox1.Text &= myProperty.Name & ControlChars.Cr
    Next myProperty
End Sub

설명

PropertyDescriptorCollection 가 읽기 전용인 경우 속성을 추가하거나 제거하는 메서드를 구현하지 않습니다. 이러한 메서드를 구현 하려면이 클래스에서 상속 해야 합니다.

클래스에서 사용할 수 있는 PropertyDescriptorCollection 속성을 사용하여 컬렉션의 내용에 대해 쿼리할 수 있습니다. 컬렉션의 요소 개수를 확인하려면 Count 속성을 사용하고, Item[] 속성을 사용하여 인덱스 번호 또는 이름으로 특정 속성을 가져옵니다.

속성 외에도 메서드를 Find 사용하여 컬렉션에서 지정된 이름의 속성에 대한 설명을 가져올 수 있습니다.

생성자

PropertyDescriptorCollection(PropertyDescriptor[])

PropertyDescriptorCollection 클래스의 새 인스턴스를 초기화합니다.

PropertyDescriptorCollection(PropertyDescriptor[], Boolean)

PropertyDescriptorCollection 클래스의 새 인스턴스를 초기화합니다. 이 인스턴스는 선택적으로 읽기 전용으로 만들 수 있습니다.

필드

Empty

항목이 없는 새 컬렉션을 만드는 대신 사용할 수 있는 빈 컬렉션을 지정합니다. 이 static 필드는 읽기 전용입니다.

속성

Count

컬렉션에 있는 속성 설명자의 개수를 가져옵니다.

Item[Int32]

지정한 인덱스 번호의 PropertyDescriptor를 가져오거나 설정합니다.

Item[String]

지정된 이름을 가진 PropertyDescriptor를 가져오거나 설정합니다.

메서드

Add(PropertyDescriptor)

지정된 PropertyDescriptor를 컬렉션에 추가합니다.

Clear()

컬렉션에서 모든 PropertyDescriptor 개체를 제거합니다.

Contains(PropertyDescriptor)

컬렉션에 지정된 PropertyDescriptor가 들어 있는지 여부를 반환합니다.

CopyTo(Array, Int32)

전체 컬렉션을 지정된 인덱스 번호에서 시작하여 배열에 복사합니다.

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
Find(String, Boolean)

대/소문자를 무시할지 여부를 나타내는 부울 값을 사용하여 지정된 이름의 PropertyDescriptor를 반환합니다.

GetEnumerator()

이 클래스에 대한 열거자를 반환합니다.

GetHashCode()

기본 해시 함수로 작동합니다.

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

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

(다음에서 상속됨 Object)
IndexOf(PropertyDescriptor)

지정된 PropertyDescriptor의 인덱스를 반환합니다.

Insert(Int32, PropertyDescriptor)

PropertyDescriptor를 지정된 컬렉션의 지정된 인덱스 번호에 추가합니다.

InternalSort(IComparer)

지정된 IComparer를 사용하여 이 컬렉션의 멤버를 정렬합니다.

InternalSort(String[])

이 컬렉션의 멤버를 정렬합니다. 지정된 순서가 먼저 적용된 다음 대개 사전순인 이 컬렉션의 기본 정렬 순서가 적용됩니다.

MemberwiseClone()

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

(다음에서 상속됨 Object)
Remove(PropertyDescriptor)

지정된 PropertyDescriptor를 컬렉션에서 제거합니다.

RemoveAt(Int32)

컬렉션에서 지정한 인덱스에 있는 PropertyDescriptor을 제거합니다.

Sort()

대개 사전순인 이 컬렉션의 기본 정렬 순서를 사용하여 이 컬렉션의 멤버를 정렬합니다.

Sort(IComparer)

지정된 IComparer를 사용하여 이 컬렉션의 멤버를 정렬합니다.

Sort(String[])

이 컬렉션의 멤버를 정렬합니다. 지정된 순서가 먼저 적용된 다음 대개 사전순인 이 컬렉션의 기본 정렬 순서가 적용됩니다.

Sort(String[], IComparer)

이 컬렉션의 멤버를 정렬합니다. 지정된 순서가 먼저 적용된 다음 지정된 IComparer를 사용하여 정렬됩니다.

ToString()

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

(다음에서 상속됨 Object)

명시적 인터페이스 구현

ICollection.Count

컬렉션에 포함된 요소 수를 가져옵니다.

ICollection.IsSynchronized

해당 컬렉션에 대한 액세스가 동기화되어 스레드로부터 안전하게 보호되는지를 나타내는 값을 가져옵니다.

ICollection.SyncRoot

컬렉션에 대한 액세스를 동기화하는 데 사용할 수 있는 개체를 가져옵니다.

IDictionary.Add(Object, Object)

제공된 키와 값을 가진 요소를 IDictionary에 추가합니다.

IDictionary.Clear()

IDictionary에서 요소를 모두 제거합니다.

IDictionary.Contains(Object)

지정된 키를 갖는 요소가 IDictionary에 들어 있는지 여부를 결정합니다.

IDictionary.GetEnumerator()

이 클래스에 대한 열거자를 반환합니다.

IDictionary.IsFixedSize

IDictionary의 크기가 고정되어 있는지 여부를 나타내는 값을 가져옵니다.

IDictionary.IsReadOnly

IDictionary가 읽기 전용인지 여부를 나타내는 값을 가져옵니다.

IDictionary.Item[Object]

지정한 키를 가진 요소를 가져오거나 설정합니다.

IDictionary.Keys

ICollection의 키를 포함하는 IDictionary을 가져옵니다.

IDictionary.Remove(Object)

IDictionary에서 키가 지정된 요소를 제거합니다.

IDictionary.Values

ICollection의 값이 들어 있는 IDictionary을 가져옵니다.

IEnumerable.GetEnumerator()

IEnumeratorIDictionary를 반환합니다.

IList.Add(Object)

IList에 항목을 추가합니다.

IList.Clear()

컬렉션에서 모든 항목을 제거합니다.

IList.Contains(Object)

컬렉션에 특정 값이 있는지 여부를 확인합니다.

IList.IndexOf(Object)

컬렉션에 있는 특정 항목의 인덱스를 확인합니다.

IList.Insert(Int32, Object)

항목을 컬렉션 내의 지정된 인덱스에 삽입합니다.

IList.IsFixedSize

컬렉션의 크기가 고정되어 있는지를 나타내는 값을 가져옵니다.

IList.IsReadOnly

컬렉션이 읽기 전용인지를 나타내는 값을 가져옵니다.

IList.Item[Int32]

컬렉션에서 지정한 인덱스에 있는 항목을 가져오거나 설정합니다.

IList.Remove(Object)

컬렉션에서 맨 처음 발견되는 지정된 값을 제거합니다.

IList.RemoveAt(Int32)

지정된 인덱스에서 항목을 제거합니다.

확장 메서드

Cast<TResult>(IEnumerable)

IEnumerable의 요소를 지정된 형식으로 캐스팅합니다.

OfType<TResult>(IEnumerable)

지정된 형식에 따라 IEnumerable의 요소를 필터링합니다.

AsParallel(IEnumerable)

쿼리를 병렬화할 수 있도록 합니다.

AsQueryable(IEnumerable)

IEnumerableIQueryable로 변환합니다.

적용 대상

추가 정보