TypeDescriptor.AddAttributes TypeDescriptor.AddAttributes TypeDescriptor.AddAttributes TypeDescriptor.AddAttributes Method

Definition

Adds class-level attributes to the target component.

Overloads

AddAttributes(Object, Attribute[]) AddAttributes(Object, Attribute[]) AddAttributes(Object, Attribute[]) AddAttributes(Object, Attribute[])

Adds class-level attributes to the target component instance.

AddAttributes(Type, Attribute[]) AddAttributes(Type, Attribute[]) AddAttributes(Type, Attribute[])

Adds class-level attributes to the target component type.

AddAttributes(Object, Attribute[]) AddAttributes(Object, Attribute[]) AddAttributes(Object, Attribute[]) AddAttributes(Object, Attribute[])

Adds class-level attributes to the target component instance.

public:
 static System::ComponentModel::TypeDescriptionProvider ^ AddAttributes(System::Object ^ instance, ... cli::array <Attribute ^> ^ attributes);
public static System.ComponentModel.TypeDescriptionProvider AddAttributes (object instance, params Attribute[] attributes);
static member AddAttributes : obj * Attribute[] -> System.ComponentModel.TypeDescriptionProvider
Public Shared Function AddAttributes (instance As Object, ParamArray attributes As Attribute()) As TypeDescriptionProvider
Parameters
instance
Object Object Object Object

An instance of the target component.

attributes
Attribute[]

An array of Attribute objects to add to the component's class.

Returns
Exceptions

Remarks

The AddAttributes(Object, Attribute[]) method adds class-level attributes to the specified instance of a component. Because this is a common requirement of applications using the Visual Studio Windows Forms Designer and Properties window, this method provides a shortcut by creating a type description provider that merges the provided attributes with the attributes that already exist on the class. The return value is the type description provider that was used to add the attributes. This provider can later be passed to the RemoveProvider(TypeDescriptionProvider, Object) method when the added attributes are no longer needed.

Security

NamedPermissionSet
for full access to system resources. Demand value: LinkDemand. Associated state:

AddAttributes(Type, Attribute[]) AddAttributes(Type, Attribute[]) AddAttributes(Type, Attribute[])

Adds class-level attributes to the target component type.

public:
 static System::ComponentModel::TypeDescriptionProvider ^ AddAttributes(Type ^ type, ... cli::array <Attribute ^> ^ attributes);
public static System.ComponentModel.TypeDescriptionProvider AddAttributes (Type type, params Attribute[] attributes);
static member AddAttributes : Type * Attribute[] -> System.ComponentModel.TypeDescriptionProvider
Parameters
type
Type Type Type Type

The Type of the target component.

attributes
Attribute[]

An array of Attribute objects to add to the component's class.

Returns
Exceptions

Remarks

The AddAttributes(Type, Attribute[]) method adds class-level attributes to the specified type of a component. Because this is a common requirement of applications using the Visual Studio Windows Forms Designer and Properties window, this method provides a shortcut by creating a type description provider that merges the provided attributes with the attributes that already exist on the class. The return value is the type description provider that was used to add the attributes. This provider can later be passed to the RemoveProvider(TypeDescriptionProvider, Type) method when the added attributes are no longer needed.

Security

NamedPermissionSet
for full access to system resources. Demand value: LinkDemand. Associated state:

Applies to