System.ComponentModel.Design.IDesignerFilter.PreFilterAttributes Method

When overridden in a derived class, allows a designer to add items to the set of attributes that it exposes through a System.ComponentModel.TypeDescriptor.

Syntax

public void PreFilterAttributes (IDictionary attributes)

Parameters

attributes
The Attribute objects for the class of the component. The keys in the dictionary of attributes are the Attribute.TypeId values of the attributes.

Remarks

This method provides a way to add items to the dictionary of attributes that the associated component of the designer implementing this interface exposes through a System.ComponentModel.TypeDescriptor.

The keys in the dictionary of attributes are the type IDs of the attributes. The objects are of type Attribute. This method is called immediately before IDesignerFilter.PostFilterAttributes(IDictionary).

The type ID of an attribute can be any object. By default, Attribute returns its Type as the value of its Attribute.TypeId property. You can check the Attribute.TypeId of an attribute in the dictionary for equivalence with a known Attribute.TypeId for an attribute to identify it, or use System.Reflection to identify the attribute object itself.

When an attribute that has the same Attribute.TypeId as an existing or inherited attribute is added to a component, the new attribute replaces the old attribute. For many attributes, a new attribute of the same type will replace any previous attribute of the type. However, some types of attributes return a Attribute.TypeId that distinguishes the attribute selectively. For example, in order to provide different types of simultaneously active designers for a type, such as an System.ComponentModel.Design.IRootDesigner and an System.ComponentModel.Design.IDesigner, the System.ComponentModel.DesignerAttribute class returns a Attribute.TypeId that uniquely identifies both the attribute and the base designer type. The System.ComponentModel.DesignerAttribute constructor allows you to specify the base designer type of the designer in addition to its specific type, and System.ComponentModel.DesignerAttribute returns a Attribute.TypeId that reflects this. Therefore when you add a new System.ComponentModel.DesignerAttribute with a base designer type of the same type as the base designer type of an existing System.ComponentModel.DesignerAttribute, the old attribute is replaced with the new attribute.

Requirements

Namespace: System.ComponentModel.Design
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0