Share via


GridViewDesigner.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 を実装するコレクション。

次のコード例は、 からGridViewDesigner継承されたクラスの メソッドをオーバーライドPreFilterPropertiesして、デザイン時にコントロールの [プロパティ] グリッドを変更する方法をGridView示しています。 この例では、 プロパティを Page[プロパティ ] グリッドに表示します。

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

    // Make the Page visible in the Properties grid.
    PropertyDescriptor selectProp = 
        (PropertyDescriptor)properties["Page"];
    properties["Page"] =
        TypeDescriptor.CreateProperty(selectProp.ComponentType, 
            selectProp, BrowsableAttribute.Yes);
} // PreFilterProperties
' Shadow the control properties with design-time properties.
Protected Overrides Sub PreFilterProperties( _
    ByVal properties As IDictionary)

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

    ' Make the Page visible in the Properties grid.
    Dim selectProp As PropertyDescriptor = _
        CType(properties("Page"), PropertyDescriptor)
    properties("Page") = _
        TypeDescriptor.CreateProperty(selectProp.ComponentType, _
            selectProp, BrowsableAttribute.Yes)
End Sub

注釈

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

コントロールの GridView 場合、 メソッドは PreFilterProperties 、コントロールが BrowsableAttribute テンプレート モードのときに、 プロパティの Columns オブジェクトを に false 設定します。 これは、テンプレート モードの列を [ フィールド] ダイアログ ボックスを使用して削除できないようにするためです。

注意 (継承者)

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

適用対象

こちらもご覧ください