AccessDataSourceDesigner.PreFilterProperties(IDictionary) メソッド

定義

[プロパティ] グリッドのプロパティの追加や削除、または、関連付けられたコントロールのプロパティをシャドウするために、デザイナーによって使用されます。

protected:
 override void PreFilterProperties(System::Collections::IDictionary ^ properties);
protected override void PreFilterProperties (System.Collections.IDictionary properties);
override this.PreFilterProperties : System.Collections.IDictionary -> unit
Protected Overrides Sub PreFilterProperties (properties As IDictionary)

パラメーター

properties
IDictionary

追加されたプロパティおよびシャドウ プロパティの IDictionary を実装するコレクション。

次のコード例は、 メソッドを PreFilterProperties オーバーライドしてプロパティを ConnectionString 読み取り専用にし、 プロパティ グリッドに表示する方法を示しています。

このコード例は、AccessDataSourceDesigner クラスのために提供されている大規模な例の一部です。

// Shadow control properties with design time properties.
protected override void PreFilterProperties(IDictionary properties)
{
    // Call the base class method first.
    base.PreFilterProperties(properties);

    // Add the ConnectionString property to the property grid.
    PropertyDescriptor property =
        (PropertyDescriptor)properties["ConnectionString"];
    Attribute[] attributes = new Attribute[]
    {
        new BrowsableAttribute(true),
        new ReadOnlyAttribute(true)
    };
    properties["ConnectionString"] = TypeDescriptor.CreateProperty(
        GetType(), property, attributes);
}
' Shadow control properties with design time properties.
Protected Overrides Sub PreFilterProperties(ByVal properties As IDictionary)

    ' Call the base class method first.
    MyBase.PreFilterProperties(properties)

    ' Add the ConnectionString property to the property grid.
    Dim prop As PropertyDescriptor
    prop = CType(properties("ConnectionString"), PropertyDescriptor)

   Dim atts(1) As Attribute
    atts(0) = New BrowsableAttribute(True)
    atts(1) = New ReadOnlyAttribute(True)

    properties("ConnectionString") = TypeDescriptor.CreateProperty( _
        prop.GetType(), prop, atts)
End Sub

注釈

コントロール デザイナーは、 メソッドから派生したメソッドをComponentDesigner.PreFilterProperties使用して、デザイナーが実装する対応するデザイン時プロパティを使用してさまざまなコントロール プロパティをシャドウし、プロパティグリッドにプロパティを追加または削除します。

コントロールの AccessDataSource 場合、 メソッドは PreFilterProperties デザイン時 DataFile プロパティを作成して、コントロールの プロパティを DataFile シャドウします。

注意 (継承者)

デザイン時の PreFilterProperties(IDictionary) プロパティ コレクションにプロパティを追加したり、その属性を変更したりするには、 メソッドをオーバーライドします。 他の処理を実行する前に、必ず基本メソッドを呼び出してください。

適用対象

こちらもご覧ください