Redigera

Dela via


IDesignerFilter.PreFilterAttributes(IDictionary) Method

Definition

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

public:
 void PreFilterAttributes(System::Collections::IDictionary ^ attributes);
public void PreFilterAttributes (System.Collections.IDictionary attributes);
abstract member PreFilterAttributes : System.Collections.IDictionary -> unit
Public Sub PreFilterAttributes (attributes As IDictionary)

Parameters

attributes
IDictionary

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

Applies to

See also