Export (0) Print
Expand All

IDesignerFilter Interface

Provides an interface that enables a designer to access and filter the dictionaries of a TypeDescriptor that stores the property, attribute, and event descriptors that a component designer can expose to the design-time environment.

Namespace:  System.ComponentModel.Design
Assembly:  System (in System.dll)

public interface IDesignerFilter

The IDesignerFilter type exposes the following members.

  NameDescription
Public methodPostFilterAttributesWhen overridden in a derived class, allows a designer to change or remove items from the set of attributes that it exposes through a TypeDescriptor.
Public methodPostFilterEventsWhen overridden in a derived class, allows a designer to change or remove items from the set of events that it exposes through a TypeDescriptor.
Public methodPostFilterPropertiesWhen overridden in a derived class, allows a designer to change or remove items from the set of properties that it exposes through a TypeDescriptor.
Public methodPreFilterAttributesWhen overridden in a derived class, allows a designer to add items to the set of attributes that it exposes through a TypeDescriptor.
Public methodPreFilterEventsWhen overridden in a derived class, allows a designer to add items to the set of events that it exposes through a TypeDescriptor.
Public methodPreFilterPropertiesWhen overridden in a derived class, allows a designer to add items to the set of properties that it exposes through a TypeDescriptor.
Top

IDesignerFilter enables a designer to filter the set of property, attribute, and event descriptors that its associated component exposes through a TypeDescriptor. The methods of this interface whose names begin with Pre are called immediately before the methods whose names begin with Post.

If you want to add attribute, event, or property descriptors, use a PreFilterAttributes, PreFilterEvents, or PreFilterProperties method.

If you want to change or remove attribute, event, or property descriptors, use a PostFilterAttributes, PostFilterEvents, or PostFilterProperties method.

The following example demonstrates an override of PreFilterProperties that adds a property of the designer to the Properties window when the designer's control is selected at design time. See the example for the ControlDesigner class for a complete designer example that uses the IDesignerFilter interface.

// 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);
}

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft