Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

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.

Namespace:  System.ComponentModel.Design
Assembly:  System (in System.dll)
void PreFilterAttributes(
	IDictionary attributes
)

Parameters

attributes
Type: System.Collections.IDictionary
The Attribute objects for the class of the component. The keys in the dictionary of attributes are the TypeId values of the attributes.

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

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.