Export (0) Print
Expand All

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 TypeDescriptor.

[Visual Basic]
Sub PreFilterAttributes( _
   ByVal attributes As IDictionary _
)
[C#]
void PreFilterAttributes(
   IDictionary attributes
);
[C++]
void PreFilterAttributes(
   IDictionary* attributes
);
[JScript]
function PreFilterAttributes(
   attributes : IDictionary
);

Parameters

attributes
The Attribute objects for the class of the component. The keys in the dictionary of attributes are the 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 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 after PostFilterAttributes.

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

When an attribute that has the same 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 TypeID that distinguishes the attribute selectively. For example, in order to provide different types of simultaneously active designers for a type, such as an IRootDesigner and an IDesigner, the DesignerAttribute class returns a TypeID that uniquely identifies both the attribute and the base designer type. The DesignerAttribute constructor allows you to specify the base designer type of the designer in addition to its specific type, and DesignerAttribute returns a TypeID that reflects this. Therefore when you add a new DesignerAttribute with a base designer type of the same type as the base designer type of an existing DesignerAttribute, the old attribute is replaced with the new attribute.

Notes to Implementers:  You can directly filter the dictionary that is accessible through the attributes parameter, or you can leave it unchanged. If you are overriding this method, call the base implementation after you perform your own filtering.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

IDesignerFilter Interface | IDesignerFilter Members | System.ComponentModel.Design Namespace | FilterAttributes

Show:
© 2014 Microsoft