IDesignerFilter インターフェイス

定義

コンポーネント デザイナーがデザイン時環境に対して公開できるプロパティ、属性、イベントの各記述子を格納する TypeDescriptor のディクショナリにデザイナーがアクセスし、フィルター処理を実行できるようにするインターフェイスを提供します。

public interface class IDesignerFilter
public interface IDesignerFilter
type IDesignerFilter = interface
Public Interface IDesignerFilter
派生

次の例では、デザイン時にデザイナーのコントロールが選択されたときにデザイナーのプロパティをプロパティ ウィンドウに追加する のオーバーライドPreFilterPropertiesを示します。 インターフェイスを使用する ControlDesigner 完全なデザイナーの例については、 クラスの例を IDesignerFilter 参照してください。

protected:
   [ReflectionPermission(SecurityAction::Demand, Flags=ReflectionPermissionFlag::MemberAccess)]
   virtual void PreFilterProperties( System::Collections::IDictionary^ properties ) override
   {
      properties->Add( "OutlineColor", TypeDescriptor::CreateProperty( TestControlDesigner::typeid, "OutlineColor", System::Drawing::Color::typeid, nullptr ) );
   }
// Adds a property to this designer's control at design time 
// that indicates the outline color to use. 
// The DesignOnlyAttribute ensures that the OutlineColor
// property is not serialized by the designer.
protected override void PreFilterProperties(System.Collections.IDictionary properties)
{
    PropertyDescriptor pd = TypeDescriptor.CreateProperty(
        typeof(ExampleControlDesigner), 
        "OutlineColor",
        typeof(System.Drawing.Color),
        new Attribute[] { new DesignOnlyAttribute(true) });

    properties.Add("OutlineColor", pd);
}
' Adds a property to this designer's control at design time 
' that indicates the outline color to use.
' The DesignOnlyAttribute ensures that the OutlineColor
' property is not serialized by the designer.
Protected Overrides Sub PreFilterProperties(ByVal properties As System.Collections.IDictionary)
    Dim pd As PropertyDescriptor = TypeDescriptor.CreateProperty( _
    GetType(ExampleControlDesigner), _
    "OutlineColor", _
    GetType(System.Drawing.Color), _
    New Attribute() {New DesignOnlyAttribute(True)})

    properties.Add("OutlineColor", pd)
End Sub

注釈

IDesignerFilter を使用すると、デザイナーは、関連付けられたコンポーネントが を介して公開するプロパティ、属性、およびイベント記述子のセットを TypeDescriptorフィルター処理できます。 名前が で始まるこのインターフェイスのメソッドは、名前が でPrePost始まるメソッドの直前に呼び出されます。

属性、イベント、またはプロパティ記述子を追加する場合は、または PreFilterProperties メソッドをPreFilterAttributesPreFilterEvents使用します。

属性、イベント、またはプロパティ記述子を変更または削除する場合は、または PostFilterProperties メソッドをPostFilterAttributesPostFilterEvents使用します。

メソッド

PostFilterAttributes(IDictionary)

派生クラスでオーバーライドされた場合、デザイナーが TypeDescriptor を通じて公開する一連の属性の項目を変更または削除できるようにします。

PostFilterEvents(IDictionary)

派生クラスでオーバーライドされた場合、デザイナーが TypeDescriptor を通じて公開する一連のイベントの項目を変更または削除できるようになります。

PostFilterProperties(IDictionary)

派生クラスでオーバーライドされた場合、デザイナーが TypeDescriptor を通じて公開する一連のプロパティの項目を変更または削除できるようになります。

PreFilterAttributes(IDictionary)

派生クラスでオーバーライドされた場合、デザイナーが TypeDescriptor を通じて公開する一連の属性に項目を追加できるようにします。

PreFilterEvents(IDictionary)

派生クラスでオーバーライドされた場合、デザイナーが TypeDescriptor を通じて公開する一連のイベントに項目を追加できるようにします。

PreFilterProperties(IDictionary)

派生クラスでオーバーライドされた場合、デザイナーが TypeDescriptor を通じて公開する一連のプロパティに項目を追加できるようにします。

適用対象

こちらもご覧ください