IDesignerFilter インターフェイス
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
コンポーネント デザイナーがデザイン時環境に公開できるプロパティ、属性、およびイベント記述子を格納する TypeDescriptor のディクショナリにデザイナーがアクセスしてフィルター処理できるようにするインターフェイスを提供します。
public interface class IDesignerFilter
public interface IDesignerFilter
type IDesignerFilter = interface
Public Interface IDesignerFilter
- 派生
例
次の例では、デザイン時にデザイナーのコントロールが選択されたときにデザイナーのプロパティをプロパティ ウィンドウに追加するPreFilterPropertiesのオーバーライドを示します。 IDesignerFilter インターフェイスを使用する完全なデザイナーの例については、ControlDesigner クラスの例を参照してください。
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を介して公開するプロパティ、属性、およびイベント記述子のセットをフィルター処理できます。 名前が Pre で始まるこのインターフェイスのメソッドは、名前が Post で始まるメソッドの直前に呼び出されます。
属性、イベント、またはプロパティ記述子を追加する場合は、 PreFilterAttributes、 PreFilterEvents、または PreFilterProperties メソッドを使用します。
属性、イベント、またはプロパティ記述子を変更または削除する場合は、 PostFilterAttributes、 PostFilterEvents、または PostFilterProperties メソッドを使用します。
メソッド
| 名前 | 説明 |
|---|---|
| PostFilterAttributes(IDictionary) |
派生クラスでオーバーライドされると、デザイナーは、 TypeDescriptorを介して公開される属性のセットから項目を変更または削除できます。 |
| PostFilterEvents(IDictionary) |
派生クラスでオーバーライドされると、デザイナーは、 TypeDescriptorを介して公開するイベントのセットから項目を変更または削除できます。 |
| PostFilterProperties(IDictionary) |
派生クラスでオーバーライドされると、デザイナーは、 TypeDescriptorを介して公開されるプロパティのセットから項目を変更または削除できます。 |
| PreFilterAttributes(IDictionary) |
派生クラスでオーバーライドされると、デザイナーは、 TypeDescriptorを介して公開する属性のセットに項目を追加できます。 |
| PreFilterEvents(IDictionary) |
派生クラスでオーバーライドされると、デザイナーは、 TypeDescriptorを介して公開するイベントのセットに項目を追加できます。 |
| PreFilterProperties(IDictionary) |
派生クラスでオーバーライドされると、デザイナーは、 TypeDescriptorを介して公開するプロパティのセットに項目を追加できます。 |