次の方法で共有


PropertyGridObject.ICustomTypeDescriptor.GetProperties メソッド

定義

プロパティ グリッドのプロパティを返します。

オーバーロード

ICustomTypeDescriptor.GetProperties()

プロパティ グリッドのプロパティを返します。

ICustomTypeDescriptor.GetProperties(Attribute[])

指定した属性配列をフィルターとして使用して、プロパティ グリッドのプロパティを返します。

ICustomTypeDescriptor.GetProperties()

プロパティ グリッドのプロパティを返します。

 virtual System::ComponentModel::PropertyDescriptorCollection ^ System.ComponentModel.ICustomTypeDescriptor.GetProperties() = System::ComponentModel::ICustomTypeDescriptor::GetProperties;
System.ComponentModel.PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties ();
Function GetProperties () As PropertyDescriptorCollection Implements ICustomTypeDescriptor.GetProperties

戻り値

PropertyDescriptorCollectionプロパティ グリッドのプロパティを表す オブジェクト。

実装

次の例では、 オーバーロードを <xref:Microsoft.Web.Management.Client.PropertyGridObject.System.ComponentModel.ICustomTypeDescriptor.GetProperties> 複製します。

private PropertyDescriptorCollection MyGetPropertiesImpl(
    Attribute[] attributes) {
    PropertyDescriptorCollection props = 
        GetProperties(attributes);

    if (ReadOnly) {
        Type thisType = GetType();
        ArrayList readOnlyProperties = new ArrayList();
        foreach (PropertyDescriptor prop in props) {
            readOnlyProperties.Add(
                TypeDescriptor.CreateProperty(
                thisType, prop, 
                new ReadOnlyAttribute(true))
                );
        }

        props = new PropertyDescriptorCollection(
            (PropertyDescriptor[])readOnlyProperties.ToArray(
            typeof(PropertyDescriptor))
            );
    }

    return props;
} 

適用対象

ICustomTypeDescriptor.GetProperties(Attribute[])

指定した属性配列をフィルターとして使用して、プロパティ グリッドのプロパティを返します。

 virtual System::ComponentModel::PropertyDescriptorCollection ^ System.ComponentModel.ICustomTypeDescriptor.GetProperties(cli::array <Attribute ^> ^ attributes) = System::ComponentModel::ICustomTypeDescriptor::GetProperties;
System.ComponentModel.PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties (Attribute[] attributes);
Function GetProperties (attributes As Attribute()) As PropertyDescriptorCollection Implements ICustomTypeDescriptor.GetProperties

パラメーター

attributes
Attribute[]

プロパティを Attribute フィルター処理するオブジェクトの配列。

戻り値

特定の属性セット Attribute に一致するプロパティ グリッドのプロパティを表す オブジェクトの配列。

実装

次の例では、 オーバーロードを <xref:Microsoft.Web.Management.Client.PropertyGridObject.System.ComponentModel.ICustomTypeDescriptor.GetProperties%28System.Attribute%5B%5D%29> 複製します。

private PropertyDescriptorCollection MyGetPropertiesImpl(
    Attribute[] attributes) {
    PropertyDescriptorCollection props = 
        GetProperties(attributes);

    if (ReadOnly) {
        Type thisType = GetType();
        ArrayList readOnlyProperties = new ArrayList();
        foreach (PropertyDescriptor prop in props) {
            readOnlyProperties.Add(
                TypeDescriptor.CreateProperty(
                thisType, prop, 
                new ReadOnlyAttribute(true))
                );
        }

        props = new PropertyDescriptorCollection(
            (PropertyDescriptor[])readOnlyProperties.ToArray(
            typeof(PropertyDescriptor))
            );
    }

    return props;
} 

適用対象